Cancel the commit cherry-picking in import
[stgit] / stgit / git.py
index 293d421..a45671b 100644 (file)
@@ -113,7 +113,10 @@ def get_conflicts():
 
 def _input(cmd, file_desc):
     p = popen2.Popen3(cmd)
-    for line in file_desc:
+    while True:
+        line = file_desc.readline()
+        if not line:
+            break
         p.tochild.write(line)
     p.tochild.close()
     if p.wait():
@@ -230,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
+    """
+    return _output(['git-rev-parse', git_id]).strip()
+
 def add(names):
     """Add the files or recursively add the directory contents
     """