Skip to content

Commit

Permalink
add reflog entries for HEAD when detached
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Jan 28, 2007
1 parent bd104db commit e1dde3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e1dde3d

Please sign in to comment.