Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Mon, 21 May 2007 02:58:03 +0000 (19:58 -0700)
committerJunio C Hamano <junkio@cox.net>
Mon, 21 May 2007 02:58:03 +0000 (19:58 -0700)
* maint:
annotate: make it work from subdirectories.
git-config: Correct asciidoc documentation for --int/--bool
t1300: Add tests for git-config --bool --get
unpack-trees.c: verify_uptodate: remove dead code
Use PATH_MAX instead of TEMPFILE_PATH_LEN
branch: fix segfault when resolving an invalid HEAD

1  2 
builtin-branch.c
diff --combined builtin-branch.c
index 6bd5843b47c0bf90c8861d160bacbfad032145e4,8956d0f84213afbd0e53e39bc863c05960f524f0..a5b6bbef6e903991cf70fd5978f5f89c48c60fb5
@@@ -462,7 -462,7 +462,7 @@@ static void create_branch(const char *n
                die("Not a valid branch point: '%s'.", start_name);
        hashcpy(sha1, commit->object.sha1);
  
 -      lock = lock_any_ref_for_update(ref, NULL);
 +      lock = lock_any_ref_for_update(ref, NULL, 0);
        if (!lock)
                die("Failed to lock ref for update: %s.", strerror(errno));
  
@@@ -623,9 -623,10 +623,10 @@@ int cmd_branch(int argc, const char **a
            (rename && force_create))
                usage(builtin_branch_usage);
  
-       head = xstrdup(resolve_ref("HEAD", head_sha1, 0, NULL));
+       head = resolve_ref("HEAD", head_sha1, 0, NULL);
        if (!head)
                die("Failed to resolve HEAD as a valid ref.");
+       head = xstrdup(head);
        if (!strcmp(head, "HEAD")) {
                detached = 1;
        }