diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-13 08:31:33 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-13 08:31:33 -0500 |
commit | d21c50ece316536b5972725eced19b40d6e2589d (patch) | |
tree | 19279560a51ae113e1841f2322e2e67ce4d4d64a /libbe/storage/vcs/git.py | |
parent | 9fa977a31982a2eda08c2c18ade73bd114f477b1 (diff) | |
download | bugseverywhere-d21c50ece316536b5972725eced19b40d6e2589d.tar.gz |
Fix Git._vcs_revision_id() offset bug.
Diffstat (limited to 'libbe/storage/vcs/git.py')
-rw-r--r-- | libbe/storage/vcs/git.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py index 0b006f3..77ddd88 100644 --- a/libbe/storage/vcs/git.py +++ b/libbe/storage/vcs/git.py @@ -25,14 +25,15 @@ import os import os.path import re import shutil -import sys import unittest import libbe import libbe.ui.util.user import base + if libbe.TESTING == True: import doctest + import sys def new(): @@ -150,7 +151,12 @@ class Git(base.VCS): raise base.CommandError(args, status, stderr=error) commits = output.splitlines() try: - return commits[index] + if index > 0: + return commits[index-1] + elif index < 0: + return commits[index] + else: + return None except IndexError: return None |