aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/git.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-29 15:49:45 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-29 15:49:45 -0400
commit22a38de80ee11ada710bc6766798ca608f938307 (patch)
treed0c3dcb844ce9c88213ef7b70c8545abd7c77559 /libbe/git.py
parent59f6dd7c96df1cb33ad9b409574cab1c26b12243 (diff)
downloadbugseverywhere-22a38de80ee11ada710bc6766798ca608f938307.tar.gz
Corrected some problems with revision_id() before an initial commit.
Diffstat (limited to 'libbe/git.py')
-rw-r--r--libbe/git.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/libbe/git.py b/libbe/git.py
index 2b45679..f7e9646 100644
--- a/libbe/git.py
+++ b/libbe/git.py
@@ -117,7 +117,12 @@ class Git(RCS):
return full_revision
def _rcs_revision_id(self, index):
args = ["rev-list", "--first-parent", "--reverse", "HEAD"]
- status,output,error = self._u_invoke_client(*args)
+ kwargs = {"expect":(0,128)}
+ status,output,error = self._u_invoke_client(*args, **kwargs)
+ if status == 128:
+ if error.startswith("fatal: ambiguous argument 'HEAD': unknown "):
+ return None
+ raise rcs.CommandError(args, status, error)
commits = output.splitlines()
try:
return commits[index]