add reflog entries for HEAD when detached
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
bd104db164
commit
e1dde3d06c
@ -259,8 +259,9 @@ if [ "$?" -eq 0 ]; then
|
||||
# git update-ref --detach HEAD $new
|
||||
# or something like that...
|
||||
#
|
||||
echo "$detached" >"$GIT_DIR/HEAD.new" &&
|
||||
mv "$GIT_DIR/HEAD.new" "$GIT_DIR/HEAD" ||
|
||||
git-rev-parse HEAD >"$GIT_DIR/HEAD.new" &&
|
||||
mv "$GIT_DIR/HEAD.new" "$GIT_DIR/HEAD" &&
|
||||
git-update-ref -m "checkout: moving to $arg" HEAD "$detached" ||
|
||||
die "Cannot detach HEAD"
|
||||
if test -n "$detach_warn"
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user