From f8fcb57bb45e8d3d8f7921377d6c2503590efc3c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 26 May 2008 15:09:51 -0700 Subject: [PATCH 1/2] show-branch --current: do not barf on detached HEAD The code assumed that there always is the current branch, but the result from resolve_ref() on detached HEAD does not even start with "refs/heads/". Originally noticed and fixed by Stephan Beyer. Signed-off-by: Junio C Hamano --- builtin-show-branch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin-show-branch.c b/builtin-show-branch.c index 019abd3527..a383323184 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -782,8 +782,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) has_head++; } if (!has_head) { - int pfxlen = strlen("refs/heads/"); - append_one_rev(head + pfxlen); + int offset = !prefixcmp(head, "refs/heads/") ? 11 : 0; + append_one_rev(head + offset); } } From df2740b066b2d6649449f2d8efdd0727647ab57c Mon Sep 17 00:00:00 2001 From: Michele Ballabio Date: Mon, 26 May 2008 15:24:02 +0200 Subject: [PATCH 2/2] Documentation: fix graph in git-rev-parse.txt Preformatted html and man pages show a mangled graph, caused by a backslash. Commit f1ec6b22a8c1ab1cca0f1875f85aea5d2434e5a6 fixed this same issue, but it seems that new versions of the Asciidoc toolchain changed their behaviour. Signed-off-by: Michele Ballabio Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 6513c2efe1..5981c79f6a 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -238,16 +238,18 @@ Here is an illustration, by Jon Loeliger. Both commit nodes B and C are parents of commit node A. Parent commits are ordered left-to-right. - G H I J - \ / \ / - D E F - \ | / \ - \ | / | - \|/ | - B C - \ / - \ / - A +........................................ +G H I J + \ / \ / + D E F + \ | / \ + \ | / | + \|/ | + B C + \ / + \ / + A +........................................ A = = A^0 B = A^ = A^1 = A~1