提交 32173e69 编写于 作者: J Junio C Hamano

Stash away the original head in ORIG_HEAD when resetting.

When rewinding the head, stash away the value of the original
HEAD in ORIG_HEAD, just like git-resolve-script does.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 045f82cb
......@@ -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"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册