manage.py: checkout commit in commit_patch()
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 8 Dec 2015 17:07:23 +0000 (19:07 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 8 Dec 2015 17:07:23 +0000 (19:07 +0200)
Do 'checkout' instead of 'reset --hard' as that fails on some old
versions of git if HEAD points to a non-existent ref (i.e. orphan
__tmp__ branch in our case).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
manage.py

index d883e8a898b6819e69fc6c1c57d1c52787b51267..b06110857335c4df504f06aab20e9cd069e4c4e3 100755 (executable)
--- a/manage.py
+++ b/manage.py
@@ -293,7 +293,7 @@ def commit_patch(commit, patchfile):
         tree = git_cmd('write-tree', None, True, None, env)[0]
         assert tree == commit['tree']
     sha1 = commit_tree(commit)
-    git_cmd('reset', ['--hard'], True)
+    git_cmd('checkout', [sha1], True)
     return sha1