summaryrefslogtreecommitdiff
path: root/git-reset-script
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-10 07:10:18 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-10 07:10:18 (GMT)
commitf69714c38c6f3296a4bfba0d057e0f1605373f49 (patch)
tree2d850f14f62d33ed514e2b197b63fe459ff20d37 /git-reset-script
parentedee414c3e5a546aae3dd1529f397df949713305 (diff)
parentc35a7b8d806317dc1762e36561cbd31c2530dd9c (diff)
downloadgit-f69714c38c6f3296a4bfba0d057e0f1605373f49.zip
git-f69714c38c6f3296a4bfba0d057e0f1605373f49.tar.gz
git-f69714c38c6f3296a4bfba0d057e0f1605373f49.tar.bz2
Merge with master.
This merges commit c35a7b8d806317dc1762e36561cbd31c2530dd9c from master into our head commit edee414c3e5a546aae3dd1529f397df949713305 Sincerely, jit-merge command.
Diffstat (limited to 'git-reset-script')
-rwxr-xr-xgit-reset-script8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-reset-script b/git-reset-script
index b6476ed..49994df 100755
--- a/git-reset-script
+++ b/git-reset-script
@@ -2,6 +2,12 @@
. git-sh-setup-script || die "Not a git archive"
rev=$(git-rev-parse --revs-only --verify --default HEAD "$@") || exit
rev=$(git-rev-parse --revs-only --verify $rev^0) || exit
-git-read-tree --reset "$rev" && echo "$rev" > "$GIT_DIR/HEAD"
+git-read-tree --reset "$rev" && {
+ if orig=$(git-rev-parse --verify HEAD 2>/dev/null)
+ then
+ echo "$orig" >"$GIT_DIR/ORIG_HEAD"
+ fi
+ echo "$rev" > "$GIT_DIR/HEAD"
+}
git-update-cache --refresh
rm -f "$GIT_DIR/MERGE_HEAD"