Commit 58c2b1c4 by Edward Thomson

UNBORN implies FAST_FORWARD

parent ac584fcf
...@@ -248,8 +248,8 @@ typedef enum { ...@@ -248,8 +248,8 @@ typedef enum {
GIT_MERGE_ANALYSIS_NORMAL = (1 << 0), GIT_MERGE_ANALYSIS_NORMAL = (1 << 0),
/** /**
* The repository is already up-to-date and no merge needs to be * All given merge inputs are reachable from HEAD, meaning the
* performed. The given merge input already exists as a parent of HEAD. * repository is up-to-date and no merge needs to be performed.
*/ */
GIT_MERGE_ANALYSIS_UP_TO_DATE = (1 << 1), GIT_MERGE_ANALYSIS_UP_TO_DATE = (1 << 1),
......
...@@ -2531,7 +2531,7 @@ int git_merge_analysis( ...@@ -2531,7 +2531,7 @@ int git_merge_analysis(
*out = GIT_MERGE_ANALYSIS_NONE; *out = GIT_MERGE_ANALYSIS_NONE;
if (git_repository_head_unborn(repo)) { if (git_repository_head_unborn(repo)) {
*out = GIT_MERGE_ANALYSIS_UNBORN; *out = GIT_MERGE_ANALYSIS_FASTFORWARD | GIT_MERGE_ANALYSIS_UNBORN;
goto done; goto done;
} }
......
...@@ -99,7 +99,8 @@ void test_merge_workdir_analysis__unborn(void) ...@@ -99,7 +99,8 @@ void test_merge_workdir_analysis__unborn(void)
p_unlink(git_buf_cstr(&master)); p_unlink(git_buf_cstr(&master));
analysis = analysis_from_branch(NOFASTFORWARD_BRANCH); analysis = analysis_from_branch(NOFASTFORWARD_BRANCH);
cl_assert_equal_i(GIT_MERGE_ANALYSIS_UNBORN, analysis); cl_assert_equal_i(GIT_MERGE_ANALYSIS_FASTFORWARD, (analysis & GIT_MERGE_ANALYSIS_FASTFORWARD));
cl_assert_equal_i(GIT_MERGE_ANALYSIS_UNBORN, (analysis & GIT_MERGE_ANALYSIS_UNBORN));
git_buf_free(&master); git_buf_free(&master);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment