chiark / gitweb /
Add support for git-rev-parse
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 27 Sep 2005 13:59:52 +0000 (14:59 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 27 Sep 2005 13:59:52 +0000 (14:59 +0100)
The git_id() function now calls git.rev_parse() if it cannot get the id.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/common.py
stgit/git.py

index c6d45351a0932870d8187c310212d44dcbfd6fa6..eacae958ae71eb4c36b8f409e2aa7cb3370ad58e 100644 (file)
@@ -56,7 +56,7 @@ def git_id(string, strict = False):
 
         # maybe GIT knows more about this id
         if not strict:
-            return git_id
+            return git.rev_parse(git_id)
     elif len(string_list) == 2:
         patch_name = string_list[0]
         if patch_name == '':
index 7ab9aefeb0ef53981c325e61ccae9640ed1a7c67..cc0ae79bf3e132a02a1c223f2dbd0254b9d3d8aa 100644 (file)
@@ -233,6 +233,11 @@ def __set_head(val):
     """
     write_string(head_link, val)
 
+def rev_parse(git_id):
+    """Parse the string and return an SHA1 id
+    """
+    _output(['git-rev-parse', git_id])
+
 def add(names):
     """Add the files or recursively add the directory contents
     """