summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2018-08-28 17:22:52 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-29 11:32:49 -0700
commit67947c34ae8f666e72b9406a38984fe8386f5e50 (patch)
treec9ae21d6995cf9011777cb9d336bfa14f4587fc5 /builtin/show-branch.c
parentconvert "oidcmp() != 0" to "!oideq()" (diff)
downloadtgif-67947c34ae8f666e72b9406a38984fe8386f5e50.tar.xz
convert "hashcmp() != 0" to "!hasheq()"
This rounds out the previous three patches, covering the inequality logic for the "hash" variant of the functions. As with the previous three, the accompanying code changes are the mechanical result of applying the coccinelle patch; see those patches for more discussion. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r--builtin/show-branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 5f9432861b..65f4a4c83c 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -485,7 +485,7 @@ static void snarf_refs(int head, int remotes)
static int rev_is_head(const char *head, const char *name,
unsigned char *head_sha1, unsigned char *sha1)
{
- if (!head || (head_sha1 && sha1 && hashcmp(head_sha1, sha1)))
+ if (!head || (head_sha1 && sha1 && !hasheq(head_sha1, sha1)))
return 0;
skip_prefix(head, "refs/heads/", &head);
if (!skip_prefix(name, "refs/heads/", &name))