summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 2b6322fad0..72e6ac6a6e 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -911,10 +911,8 @@ static int grab_nth_branch_switch(unsigned char *osha1, unsigned char *nsha1,
const char *match = NULL, *target = NULL;
size_t len;
- if (starts_with(message, "checkout: moving from ")) {
- match = message + strlen("checkout: moving from ");
+ if (skip_prefix(message, "checkout: moving from ", &match))
target = strstr(match, " to ");
- }
if (!match || !target)
return 0;