{"thread":{"id":"5643","subject":"[PATCH] show-branch: mark active branch with a '*' again","startedAt":"2006-09-21T22:07:01Z","lastAt":"2006-09-21T22:07:01Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27389","messageId":"Pine.LNX.4.63.0609220006010.19042@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5643","inReplyTo":null,"subject":"[PATCH] show-branch: mark active branch with a '*' again","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-09-21T22:07:01Z","receivedAt":"2006-09-21T22:07:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis was lost in the packed-ref updates. The original test was a bit\ndubious, so I cleaned that up, too. It fixes the case when the current HEAD\nis refs/heads/bla/master: the original test was true for both bla/master\n_and_ master.\n\nHowever, it shares a hard-to-fix bug with the original test: if the current\nHEAD is refs/heads/master, and there is a branch refs/heads/heads/master,\nthen both are marked active.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\t... and since nobody uses headlen, there is no need to fix that up.\n\n builtin-show-branch.c |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-show-branch.c b/builtin-show-branch.c\nindex 5d6ce56..fb1a400 100644\n--- a/builtin-show-branch.c\n+++ b/builtin-show-branch.c\n@@ -443,6 +443,12 @@ static int rev_is_head(char *head, int h\n \tif ((!head[0]) ||\n \t    (head_sha1 && sha1 && hashcmp(head_sha1, sha1)))\n \t\treturn 0;\n+\tif (!strncmp(head, \"refs/heads/\", 11))\n+\t\thead += 11;\n+\tif (!strncmp(name, \"refs/heads/\", 11))\n+\t\tname += 11;\n+\telse if (!strncmp(name, \"heads/\", 6))\n+\t\tname += 6;\n \treturn !strcmp(head, name);\n }\n \n-- \n1.4.2.1.g9797-dirty\n"}]}