diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-03 16:08:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-03 16:08:23 -0700 |
commit | 9b8ae93ad92efef59649a3a7c4bed162d2051059 (patch) | |
tree | 0661cd870dec63e098efef7e1fb7db31505dbbb2 /builtin-checkout.c | |
parent | 01914577ed42498d9e268684949d699e0272e964 (diff) | |
parent | de5d560c99c96e2955fb4d1d8a8fa6b469926292 (diff) | |
download | git-9b8ae93ad92efef59649a3a7c4bed162d2051059.tar.gz |
Merge branch 'maint'
* maint:
Start 1.6.0.2 maintenance cycle
tests: use "git xyzzy" form (t7200 - t9001)
tests: use "git xyzzy" form (t7000 - t7199)
Fix passwd(5) ref and reflect that commit doens't use commit-tree
improve handling of sideband message display
tests: use "git xyzzy" form (t3600 - t6999)
tests: use "git xyzzy" form (t0000 - t3599)
checkout: fix message when leaving detached HEAD
clone: fix creation of explicitly named target directory
'git foo' program identifies itself without dash in die() messages
setup_git_directory(): fix move to worktree toplevel directory
update-index: fix worktree setup
Start conforming code to "git subcmd" style
read-tree: setup worktree if merge is required
grep: fix worktree setup
diff*: fix worktree setup
Conflicts:
RelNotes
t/t3900-i18n-commit.sh
t/t7003-filter-branch.sh
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r-- | builtin-checkout.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c index b380ad6e80..efdb1e02bf 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -386,13 +386,11 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new) } /* - * If the new thing isn't a branch and isn't HEAD and we're - * not starting a new branch, and we want messages, and we - * weren't on a branch, and we're moving to a new commit, - * describe the old commit. + * If we were on a detached HEAD, but we are now moving to + * a new commit, we want to mention the old commit once more + * to remind the user that it might be lost. */ - if (!new->path && strcmp(new->name, "HEAD") && !opts->new_branch && - !opts->quiet && !old.path && new->commit != old.commit) + if (!opts->quiet && !old.path && new->commit != old.commit) describe_detached_head("Previous HEAD position was", old.commit); if (!old.commit) { |