OSDN Git Service

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sun, 9 Nov 2008 18:56:26 +0000 (10:56 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Nov 2008 18:56:26 +0000 (10:56 -0800)
* 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.

1  2 
Documentation/rev-list-options.txt
builtin-checkout.c

Simple merge
@@@ -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);