git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 2/7] t6044: add a testcase for index matching head, when head doesn't match HEAD

From
Elijah Newren <newren@gmail.com>
Date
Jul 11, 2018, 03:09 UTC
Message-ID
<20180711030923.26499-1-newren@gmail.com>
In-Reply-To
<20180710203922.26367-1-szeder.dev@gmail.com>
On Tue, Jul 10, 2018 at 1:39 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 32 quoted lines
>> 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
>
Good catch; thanks for pointing it out.  Here's a fix:
-- 8< --
Subject: [PATCH] fixup! t6044: add a testcase for index matching head, when
 head doesn't match HEAD
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6044-merge-unrelated-index-changes.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t6044-merge-unrelated-index-changes.sh b/t/t6044-merge-unrelated-index-changes.sh
index 6e0ecab9c..5e3779ebc 100755
--- a/t/t6044-merge-unrelated-index-changes.sh
+++ b/t/t6044-merge-unrelated-index-changes.sh
@@ -131,7 +131,7 @@ test_expect_success 'merge-recursive, when index==head but head!=HEAD' '
 	git checkout C^0 &&
 
 	# Make index match B
-	git diff C B | git apply --cached &&
+	git diff C B -- | git apply --cached &&
 	# Merge B & F, with B as "head"
 	git merge-recursive A -- B F > out &&
 	test_i18ngrep "Already up to date" out
-- 
2.18.0.132.g6e63b23f4
Previous: SZEDER GáborNext: Elijah Newren
Message 23 of 30 in “merge requirement: index matches head”
  1. 0/7 merge requirement: index matches headElijah Newren, Jun 3, 2018
  2. 3/7 merge-recursive: make sure when we say we abort that we actually abortElijah Newren, Jun 3, 2018
  3. 2/7 t6044: add a testcase for index matching head, when head doesn't match HEADElijah Newren, Jun 3, 2018
  4. 5/7 t6044: add more testcases with staged changes before a merge is invokedElijah Newren, Jun 3, 2018
  5. 6/7 merge-recursive: enforce rule that index matches head before mergingElijah Newren, Jun 3, 2018
  6. 7/7 merge: fix misleading pre-merge check documentationElijah Newren, Jun 3, 2018
  7. Elijah NewrenJun 7, 2018
  8. 4/7 merge-recursive: fix assumption that head tree being merged is HEADElijah Newren, Jun 3, 2018
  9. Ramsay JonesJun 3, 2018
  10. brian m. carlsonJun 3, 2018
  11. Ramsay JonesJun 4, 2018
  12. Junio C HamanoJun 4, 2018
  13. Elijah NewrenJun 5, 2018
  14. Elijah NewrenJun 11, 2018
  15. 1/7 t6044: verify that merges expected to abort actually abortElijah Newren, Jun 3, 2018
  16. 0/9 Fix merge issues with index not matching HEADElijah Newren, Jul 1, 2018
  17. 1/9 read-cache.c: move index_has_changes() from merge.cElijah Newren, Jul 1, 2018
  18. 2/9 index_has_changes(): avoid assuming operating on the_indexElijah Newren, Jul 1, 2018
  19. Junio C HamanoJul 3, 2018
  20. 3/9 t6044: verify that merges expected to abort actually abortElijah Newren, Jul 1, 2018
  21. 4/9 t6044: add a testcase for index matching head, when head doesn't match HEADElijah Newren, Jul 1, 2018
  22. SZEDER GáborJul 10, 2018
  23. Elijah NewrenJul 11, 2018
  24. 8/9 merge-recursive: enforce rule that index matches head before mergingElijah Newren, Jul 1, 2018
  25. Junio C HamanoJul 3, 2018
  26. 5/9 merge-recursive: make sure when we say we abort that we actually abortElijah Newren, Jul 1, 2018
  27. 6/9 merge-recursive: fix assumption that head tree being merged is HEADElijah Newren, Jul 1, 2018
  28. Junio C HamanoJul 3, 2018
  29. 7/9 t6044: add more testcases with staged changes before a merge is invokedElijah Newren, Jul 1, 2018
  30. 9/9 merge: fix misleading pre-merge check documentationElijah Newren, Jul 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.