Skip to content

Commit 82fa169

Browse files
committed
Merge branch 'ma/simplify-merge-config-parsing'
Code simplification. * ma/simplify-merge-config-parsing: merge: use skip_prefix to parse config key
2 parents b3eb70e + 9881b45 commit 82fa169

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

builtin/merge.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,12 @@ static void parse_branch_merge_options(char *bmo)
597597
static int git_merge_config(const char *k, const char *v, void *cb)
598598
{
599599
int status;
600+
const char *str;
600601

601-
if (branch && starts_with(k, "branch.") &&
602-
starts_with(k + 7, branch) &&
603-
!strcmp(k + 7 + strlen(branch), ".mergeoptions")) {
602+
if (branch &&
603+
skip_prefix(k, "branch.", &str) &&
604+
skip_prefix(str, branch, &str) &&
605+
!strcmp(str, ".mergeoptions")) {
604606
free(branch_mergeoptions);
605607
branch_mergeoptions = xstrdup(v);
606608
return 0;

0 commit comments

Comments
 (0)