diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:56 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-04-22 13:42:56 -0700 |
| commit | 82fa169d551d71fd21d8a6368040e19d209f79ab (patch) | |
| tree | 9ea4a78018a370d809350be858d9010b659a9b18 | |
| parent | b3eb70e0f8988dbf36f42e0bea201e2cd71f248e (diff) | |
| parent | 9881b451f33b7b0df247a4b28a9c08c65eb4ca95 (diff) | |
| download | git-82fa169d551d71fd21d8a6368040e19d209f79ab.tar.gz | |
Merge branch 'ma/simplify-merge-config-parsing'
Code simplification.
* ma/simplify-merge-config-parsing:
merge: use skip_prefix to parse config key
| -rw-r--r-- | builtin/merge.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index d127d2225f..df83ba2a80 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -597,10 +597,12 @@ static void parse_branch_merge_options(char *bmo) static int git_merge_config(const char *k, const char *v, void *cb) { int status; + const char *str; - if (branch && starts_with(k, "branch.") && - starts_with(k + 7, branch) && - !strcmp(k + 7 + strlen(branch), ".mergeoptions")) { + if (branch && + skip_prefix(k, "branch.", &str) && + skip_prefix(str, branch, &str) && + !strcmp(str, ".mergeoptions")) { free(branch_mergeoptions); branch_mergeoptions = xstrdup(v); return 0; |
