diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-06-29 17:03:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-06-29 17:03:10 -0700 |
commit | 0faf247485c2dc92fd8b492a5c4b49237e0338ee (patch) | |
tree | 11dd5084b96ee09a38257693a6a29cbb6b3ab081 | |
parent | Merge branch 'jk/combine-diff-binary-etc' (diff) | |
parent | checkout: make advice when reattaching the HEAD less loud (diff) | |
download | tgif-0faf247485c2dc92fd8b492a5c4b49237e0338ee.tar.xz |
Merge branch 'jc/advice-about-to-lose-commit'
* jc/advice-about-to-lose-commit:
checkout: make advice when reattaching the HEAD less loud
Conflicts:
builtin/checkout.c
-rw-r--r-- | builtin/checkout.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 28cdc51b85..015730fbd5 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -657,24 +657,25 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs) "Warning: you are leaving %d commit behind, " "not connected to\n" "any of your branches:\n\n" - "%s\n" - "If you want to keep it by creating a new branch, " - "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n", + "%s\n", /* The plural version */ "Warning: you are leaving %d commits behind, " "not connected to\n" "any of your branches:\n\n" - "%s\n" - "If you want to keep them by creating a new branch, " - "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n", + "%s\n", /* Give ngettext() the count */ lost), lost, - sb.buf, - sha1_to_hex(commit->object.sha1)); + sb.buf); strbuf_release(&sb); + + if (advice_detached_head) + fprintf(stderr, + _( + "If you want to keep them by creating a new branch, " + "this may be a good time\nto do so with:\n\n" + " git branch new_branch_name %s\n\n"), + sha1_to_hex(commit->object.sha1)); } /* |