diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-12-19 12:32:20 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-12-19 12:32:20 +0100 |
commit | 000c5eb8fb13049922bebbb1e116d58b7f739928 (patch) | |
tree | 35d8986d1f92ff54c361c4d85a05e0a9fe11343d | |
parent | 50760a202b4d655d828cd420fa5745210e33f657 (diff) |
Correctly deal with ambiguous repo names.
-rwxr-xr-x | gitnoti.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -239,6 +239,10 @@ class Bot(irc.IRCClient): elif len(repo) == 0: self.msg(target, 'No repo found.') else: + s = [r for r in repo if os.path.splitext(os.path.basename(r.path))[0] == name] + # Check for equal match if we're giving an ambiguous name + if len(s) == 1: + return s[0].repo self.msg(target, 'Ambiguous name: %s' % (', '.join([os.path.splitext(os.path.basename(x.path))[0] for x in repo]))) return None |