diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-05-02 11:07:17 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-05-02 11:09:08 +0200 |
commit | cc4647d9b5d30d2a74e15d358b18a7db6b4cac25 (patch) | |
tree | 949c7e62715c3d5a0eb5478eb9daa49a0f6155ef | |
parent | 9521e6c65c37d887ccf681c53d2addba31afbc03 (diff) | |
download | git-buildpackage-cc4647d9b5d30d2a74e15d358b18a7db6b4cac25.tar.gz git-buildpackage-cc4647d9b5d30d2a74e15d358b18a7db6b4cac25.tar.bz2 git-buildpackage-cc4647d9b5d30d2a74e15d358b18a7db6b4cac25.zip |
Don't assume the repo has a '/'
-rwxr-xr-x | examples/zeitgeist-git.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/zeitgeist-git.py b/examples/zeitgeist-git.py index ba184d6f..279cc530 100755 --- a/examples/zeitgeist-git.py +++ b/examples/zeitgeist-git.py @@ -59,7 +59,14 @@ def get_repo(): if uri: uri = uri.strip().decode(sys.getfilesystemencoding()) - repo = unicode(uri.rsplit('/', 1)[1]) + if '/' in uri: + sep = '/' + else: + sep = ':' + try: + repo = unicode(uri.rsplit(sep, 1)[1]) + except IndexError: # no known separator + repo = uri repo = repo.rsplit(u'.git', 1)[0] return repo, uri |