Subject: Re: [PATCH v2 4/9] t6044: add a testcase for index matching head, when head doesn't match HEAD

From: SZEDER Gábor <[email-masked]>
Date: Tue, 10 Jul 2018 22:39:22 +0200

> diff --git a/t/t6044-merge-unrelated-index-changes.sh b/t/t6044-merge-unrelated-index-changes.sh
> index f9c2f8179..92ec55255 100755
> --- a/t/t6044-merge-unrelated-index-changes.sh
> +++ b/t/t6044-merge-unrelated-index-changes.sh
> @@ -126,6 +126,17 @@ test_expect_failure 'recursive, when merge branch matches merge base' '
>  	test_path_is_missing .git/MERGE_HEAD
>  '
>  
> +test_expect_failure 'merge-recursive, when index==head but head!=HEAD' '
> +	git reset --hard &&
> +	git checkout C^0 &&
> +
> +	# Make index match B
> +	git diff C B | git apply --cached &&

Branch 'C' contains the file 'c', which creates ambiguity on
case-insensitive file systems and makes the test fail:

  ++git reset --hard
  HEAD is now at ed5d5a6 B
  ++git checkout 'C^0'
  Previous HEAD position was ed5d5a6 B
  HEAD is now at 4fa59ce C
  ++git diff C B
  ++git apply --cached
  fatal: ambiguous argument 'C': both revision and filename
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
  error: unrecognized input
  error: last command exited with $?=128
  not ok 8 - merge-recursive, when index==head but head!=HEAD

> +	# Merge B & F, with B as "head"
> +	git merge-recursive A -- B F > out &&
> +	test_i18ngrep "Already up to date" out
> +'
> +
>  test_expect_success 'octopus, unrelated file touched' '
>  	git reset --hard &&
>  	git checkout B^0 &&
> -- 
> 2.18.0.137.g2a11d05a6.dirty
> 
>