diff options
author | Edward Thomson <ethomson@microsoft.com> | 2014-05-16 13:54:40 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2014-05-27 20:49:20 -0500 |
commit | a3622ba6cc0970abe485baa98ab53e32df28cfdc (patch) | |
tree | d4294632ba5db9b2f448f0c8bb1624ef6e432457 /src/merge.c | |
parent | d362093f9e858cf48d3c09bbcacf01f057b58db1 (diff) | |
download | libgit2-a3622ba6cc0970abe485baa98ab53e32df28cfdc.tar.gz |
Move GIT_MERGE_CONFIG_* to its own enum
Diffstat (limited to 'src/merge.c')
-rw-r--r-- | src/merge.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/merge.c b/src/merge.c index 85b74483b..02851e526 100644 --- a/src/merge.c +++ b/src/merge.c @@ -2564,12 +2564,14 @@ done: return error; } -int analysis_config(git_merge_analysis_t *out, git_repository *repo) +int merge_config(git_merge_config_t *out, git_repository *repo) { git_config *config; const char *value; int bool_value, error = 0; + *out = GIT_MERGE_CONFIG_NONE; + if ((error = git_repository_config(&config, repo)) < 0) goto done; @@ -2596,7 +2598,8 @@ done: } int git_merge_analysis( - git_merge_analysis_t *out, + git_merge_analysis_t *analysis_out, + git_merge_config_t *config_out, git_repository *repo, const git_merge_head **their_heads, size_t their_heads_len) @@ -2604,7 +2607,7 @@ int git_merge_analysis( git_merge_head *ancestor_head = NULL, *our_head = NULL; int error = 0; - assert(out && repo && their_heads); + assert(analysis_out && config_out && repo && their_heads); if (their_heads_len != 1) { giterr_set(GITERR_MERGE, "Can only merge a single branch"); @@ -2612,13 +2615,13 @@ int git_merge_analysis( goto done; } - *out = GIT_MERGE_ANALYSIS_NONE; + *analysis_out = GIT_MERGE_ANALYSIS_NONE; - if ((error = analysis_config(out, repo)) < 0) + if ((error = merge_config(config_out, repo)) < 0) goto done; if (git_repository_head_unborn(repo)) { - *out |= GIT_MERGE_ANALYSIS_FASTFORWARD | GIT_MERGE_ANALYSIS_UNBORN; + *analysis_out |= GIT_MERGE_ANALYSIS_FASTFORWARD | GIT_MERGE_ANALYSIS_UNBORN; goto done; } @@ -2627,15 +2630,15 @@ int git_merge_analysis( /* We're up-to-date if we're trying to merge our own common ancestor. */ if (ancestor_head && git_oid_equal(&ancestor_head->oid, &their_heads[0]->oid)) - *out |= GIT_MERGE_ANALYSIS_UP_TO_DATE; + *analysis_out |= GIT_MERGE_ANALYSIS_UP_TO_DATE; /* We're fastforwardable if we're our own common ancestor. */ else if (ancestor_head && git_oid_equal(&ancestor_head->oid, &our_head->oid)) - *out |= GIT_MERGE_ANALYSIS_FASTFORWARD | GIT_MERGE_ANALYSIS_NORMAL; + *analysis_out |= GIT_MERGE_ANALYSIS_FASTFORWARD | GIT_MERGE_ANALYSIS_NORMAL; /* Otherwise, just a normal merge is possible. */ else - *out |= GIT_MERGE_ANALYSIS_NORMAL; + *analysis_out |= GIT_MERGE_ANALYSIS_NORMAL; done: git_merge_head_free(ancestor_head); |