Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2008 02:49:01 +0000 (19:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2008 02:49:01 +0000 (19:49 -0700)
* maint:
Documentation: fix graph in git-rev-parse.txt
show-branch --current: do not barf on detached HEAD

Documentation/git-rev-parse.txt
builtin-show-branch.c
index 69599ffb679b17ebbe6ba85c772cd10a3511d89e..5641d995180b7aed563872b2403dbd29870a2185 100644 (file)
@@ -243,16 +243,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
index ee4269dd33aa0b2229eaac0ce7b75f7893447b0f..93047f5117796fb7556fa23871397e68e9f5e4c2 100644 (file)
@@ -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);
                }
        }