OSDN Git Service

Merge branch 'rs/merge-microcleanup'
authorJunio C Hamano <gitster@pobox.com>
Tue, 22 Aug 2017 17:29:14 +0000 (10:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Aug 2017 17:29:14 +0000 (10:29 -0700)
Code clean-up.

* rs/merge-microcleanup:
  merge: use skip_prefix()

builtin/merge.c

index e15f008..328945d 100644 (file)
@@ -1117,8 +1117,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