From: Elijah Newren <newren@xxxxxxxxxxxx> This almost works. It creates the correct merge commit, updates the branch, but then if the repo is bare it leaves the index as it was before the merge (and if the repo is non-bare it updates the index). I'm totally lost as to why the testcase behaves differently in the bare and non-bare cases. Signed-off-by: Elijah Newren <newren@xxxxxxxxx> --- builtin/merge.c | 3 ++- t/t6043-merge-index-only.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/merge.c b/builtin/merge.c index ce5be0a..5f463ad 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -606,7 +606,8 @@ static int read_tree_trivial(unsigned char *common, unsigned char *head, opts.head_idx = 2; opts.src_index = &the_index; opts.dst_index = &the_index; - opts.update = 1; + opts.update = !index_only; + opts.index_only = index_only; opts.verbose_update = 1; opts.trivial_merges_only = 1; opts.merge = 1; diff --git a/t/t6043-merge-index-only.sh b/t/t6043-merge-index-only.sh index 2e1d953..f79782c 100755 --- a/t/t6043-merge-index-only.sh +++ b/t/t6043-merge-index-only.sh @@ -265,7 +265,7 @@ test_expect_failure '--index-only ff update, non-bare with uncommitted changes' test ! -d subdir ' -test_expect_failure '--index-only w/ resolve, trivial, non-bare' ' +test_expect_success '--index-only w/ resolve, trivial, non-bare' ' git clean -fdx && git reset --hard && git checkout B^0 && -- 2.8.0.18.gc685494 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html