Skip to content

Commit 2fe1839

Browse files
committed
Merge branch 'maint'
* maint: Documentation: fix graph in git-rev-parse.txt show-branch --current: do not barf on detached HEAD
2 parents 2d3cfd7 + 109440c commit 2fe1839

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Documentation/git-rev-parse.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,18 @@ Here is an illustration, by Jon Loeliger. Both commit nodes B
243243
and C are parents of commit node A. Parent commits are ordered
244244
left-to-right.
245245

246-
G H I J
247-
\ / \ /
248-
D E F
249-
\ | / \
250-
\ | / |
251-
\|/ |
252-
B C
253-
\ /
254-
\ /
255-
A
246+
........................................
247+
G H I J
248+
\ / \ /
249+
D E F
250+
\ | / \
251+
\ | / |
252+
\|/ |
253+
B C
254+
\ /
255+
\ /
256+
A
257+
........................................
256258

257259
A = = A^0
258260
B = A^ = A^1 = A~1

builtin-show-branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
782782
has_head++;
783783
}
784784
if (!has_head) {
785-
int pfxlen = strlen("refs/heads/");
786-
append_one_rev(head + pfxlen);
785+
int offset = !prefixcmp(head, "refs/heads/") ? 11 : 0;
786+
append_one_rev(head + offset);
787787
}
788788
}
789789

0 commit comments

Comments
 (0)