Browse Source

add reflog entries for HEAD when detached

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Nicolas Pitre 18 years ago committed by Junio C Hamano
parent
commit
e1dde3d06c
  1. 5
      git-checkout.sh

5
git-checkout.sh

@ -259,8 +259,9 @@ if [ "$?" -eq 0 ]; then @@ -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…
Cancel
Save