Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
merge: use skip_prefix()
author
René Scharfe
<l.s.r@web.de>
Thu, 10 Aug 2017 16:47:55 +0000
(18:47 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 10 Aug 2017 20:57:00 +0000
(13:57 -0700)
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>
builtin/merge.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
7234152
)
diff --git
a/builtin/merge.c
b/builtin/merge.c
index 703827f00668ca0df807f35e300f0927d00075cd..d9db0baaf3c9368a62363fb9c3f4e550e71ce5e3 100644
(file)
--- 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