{"thread":{"id":"46556","subject":"[PATCH] merge: use skip_prefix()","startedAt":"2017-08-10T16:48:09Z","lastAt":"2017-08-10T16:48:09Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"326032","messageId":"7ebe2ff6-bc4b-3694-7978-a1f5f8628b8a@web.de","threadId":"46556","inReplyTo":null,"subject":"[PATCH] merge: use skip_prefix()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2017-08-10T16:47:55Z","receivedAt":"2017-08-10T16:48:09Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Get rid of a magic string length constant by using skip_prefix() instead\nof starts_with().\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n builtin/merge.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 900bafdb45..4facb6fdd0 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1117,8 +1117,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t * current branch.\n \t */\n \tbranch = branch_to_free = resolve_refdup(\"HEAD\", 0, head_oid.hash, NULL);\n-\tif (branch && starts_with(branch, \"refs/heads/\"))\n-\t\tbranch += 11;\n+\tif (branch)\n+\t\tskip_prefix(branch, \"refs/heads/\", &branch);\n \tif (!branch || is_null_oid(&head_oid))\n \t\thead_commit = NULL;\n \telse\n-- \n2.14.0\n"}]}