From: Junio C Hamano Date: Sun, 9 Nov 2008 18:56:26 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.6.1-rc1~73 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a9645b780b698703cd7dee25051d6ce39b0544c6;p=git.git Merge branch 'maint' * maint: Documentation: bisect: change a few instances of "git-cmd" to "git cmd" Documentation: rev-list: change a few instances of "git-cmd" to "git cmd" checkout: Don't crash when switching away from an invalid branch. --- a9645b780b698703cd7dee25051d6ce39b0544c6 diff --cc builtin-checkout.c index 57b94d282,05eee4ecc..06904c3bd --- a/builtin-checkout.c +++ b/builtin-checkout.c @@@ -491,11 -358,12 +491,11 @@@ static void update_refs_for_switch(stru setup_branch_path(new); } - strbuf_init(&msg, 0); old_desc = old->name; - if (!old_desc) + if (!old_desc && old->commit) old_desc = sha1_to_hex(old->commit->object.sha1); strbuf_addf(&msg, "checkout: moving from %s to %s", - old_desc, new->name); + old_desc ? old_desc : "(invalid)", new->name); if (new->path) { create_symref("HEAD", new->path, msg.buf);