Skip to content

Commit de3ce21

Browse files
rscharfegitster
authored andcommitted
merge: use skip_prefix()
Get rid of a magic string length constant by using skip_prefix() instead of starts_with(). Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7234152 commit de3ce21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/merge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
11181118
* current branch.
11191119
*/
11201120
branch = branch_to_free = resolve_refdup("HEAD", 0, head_oid.hash, NULL);
1121-
if (branch && starts_with(branch, "refs/heads/"))
1122-
branch += 11;
1121+
if (branch)
1122+
skip_prefix(branch, "refs/heads/", &branch);
11231123
if (!branch || is_null_oid(&head_oid))
11241124
head_commit = NULL;
11251125
else

0 commit comments

Comments
 (0)