chore: save HEAD when git-import-patches runs (#17824)

This commit is contained in:
Jeremy Apthorp 2019-04-17 11:16:03 -07:00 committed by GitHub
parent f901170a4f
commit fdaa75354a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 8 deletions

View file

@ -102,6 +102,12 @@ def get_head_commit(repo):
return subprocess.check_output(args).strip()
def update_ref(repo, ref, newvalue):
args = ['git', '-C', repo, 'update-ref', ref, newvalue]
return subprocess.check_call(args)
def reset(repo):
args = ['git', '-C', repo, 'reset']