Merge branch 'ma/simplify-merge-config-parsing'
Code simplification. * ma/simplify-merge-config-parsing: merge: use skip_prefix to parse config key
This commit is contained in:
commit
82fa169d55
@ -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)
|
static int git_merge_config(const char *k, const char *v, void *cb)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
const char *str;
|
||||||
|
|
||||||
if (branch && starts_with(k, "branch.") &&
|
if (branch &&
|
||||||
starts_with(k + 7, branch) &&
|
skip_prefix(k, "branch.", &str) &&
|
||||||
!strcmp(k + 7 + strlen(branch), ".mergeoptions")) {
|
skip_prefix(str, branch, &str) &&
|
||||||
|
!strcmp(str, ".mergeoptions")) {
|
||||||
free(branch_mergeoptions);
|
free(branch_mergeoptions);
|
||||||
branch_mergeoptions = xstrdup(v);
|
branch_mergeoptions = xstrdup(v);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user