X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fcheckout.c;h=6b9061f26f5f33ae1ded811891e933441c210fb0;hb=0df81d860eec53299a43fb8e205caa3cbd813da5;hp=a76aa2a6fd6ad076f4d10e4f5227d24b31c063ca;hpb=fce8b5d82fadd0bc27b12ae91bf7ad74d6488e97;p=git.git diff --git a/builtin/checkout.c b/builtin/checkout.c index a76aa2a6f..6b9061f26 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -514,20 +514,6 @@ static void report_tracking(struct branch_info *new) strbuf_release(&sb); } -static void detach_advice(const char *old_path, const char *new_name) -{ - const char fmt[] = - "Note: checking out '%s'.\n\n" - "You are in 'detached HEAD' state. You can look around, make experimental\n" - "changes and commit them, and you can discard any commits you make in this\n" - "state without impacting any branches by performing another checkout.\n\n" - "If you want to create a new branch to retain commits you create, you may\n" - "do so (now or later) by using -b with the checkout command again. Example:\n\n" - " git checkout -b new_branch_name\n\n"; - - fprintf(stderr, fmt, new_name); -} - static void update_refs_for_switch(struct checkout_opts *opts, struct branch_info *old, struct branch_info *new) @@ -575,7 +561,7 @@ static void update_refs_for_switch(struct checkout_opts *opts, REF_NODEREF, DIE_ON_ERR); if (!opts->quiet) { if (old->path && advice_detached_head) - detach_advice(old->path, new->name); + detach_advice(new->name); describe_detached_head(_("HEAD is now at"), new->commit); } } else if (new->path) { /* Switch branches. */