summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-12-19 12:32:20 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-12-19 12:32:20 +0100
commit000c5eb8fb13049922bebbb1e116d58b7f739928 (patch)
tree35d8986d1f92ff54c361c4d85a05e0a9fe11343d
parent50760a202b4d655d828cd420fa5745210e33f657 (diff)
Correctly deal with ambiguous repo names.
-rwxr-xr-xgitnoti.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gitnoti.py b/gitnoti.py
index b18f26d..dfd79c3 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -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