X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/7c09df84663028d46af9d79d0cbb37532f94deb8..b8a0986f754570589675e7003d06b78bdd290a02:/stgit/git.py diff --git a/stgit/git.py b/stgit/git.py index 293d421..a45671b 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -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 """