From 000c5eb8fb13049922bebbb1e116d58b7f739928 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 19 Dec 2010 12:32:20 +0100 Subject: Correctly deal with ambiguous repo names. --- gitnoti.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3