From: Junio C Hamano Date: Mon, 21 May 2007 02:58:03 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.3-rc0~214 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/738a1154db190c75a7454da85d85be68ad7db065?ds=inline;hp=-c Merge branch 'maint' * 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 --- 738a1154db190c75a7454da85d85be68ad7db065 diff --combined builtin-branch.c index 6bd5843b47,8956d0f842..a5b6bbef6e --- a/builtin-branch.c +++ b/builtin-branch.c @@@ -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; }