summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-08-10 18:47:55 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-10 13:57:00 -0700
commitde3ce210edb4870b082fab18148f859d2b3c9ae2 (patch)
tree4391e4595db9840a5aeab9b35b076f6272bf5cf1
parent7234152e66e52c7601789f6de822bb39590f0595 (diff)
downloadgit-rs/merge-microcleanup.tar.gz
merge: use skip_prefix()rs/merge-microcleanup
Get rid of a magic string length constant by using skip_prefix() instead of starts_with(). Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/merge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 703827f006..d9db0baaf3 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1118,8 +1118,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
* current branch.
*/
branch = branch_to_free = resolve_refdup("HEAD", 0, head_oid.hash, NULL);
- if (branch && starts_with(branch, "refs/heads/"))
- branch += 11;
+ if (branch)
+ skip_prefix(branch, "refs/heads/", &branch);
if (!branch || is_null_oid(&head_oid))
head_commit = NULL;
else