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

[PATCH 2/4] t7607: clean up stray untracked file

From
Jeff King <peff@peff.net>
Date
Mar 25, 2011, 18:09 UTC
Message-ID
<20110325180903.GB14898@sigill.intra.peff.net>
In-Reply-To
<20110325180644.GA30838@sigill.intra.peff.net>

This file ends up conflicting with the test just after it (causing the "git merge" to fail). Neither test is to blame for the bug, though. It looks like the merge in 1a9fe45 (Merge branch 'tr/merge-unborn-clobber', 2011-02-09) is what caused the conflict.

We didn't notice because the follow-on test is already marked as expect_failure (even though it has since been fixed, and now succeeds once the untracked file is moved out of the way).

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t7607-merge-overwrite.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index 691c5fd..c86e298 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -150,6 +150,7 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
 	git rm -fr . &&
 	git checkout --orphan new &&
 	cp important c0.c &&
+	test_when_finished "rm c0.c" &&
 	test_must_fail git merge c0 2>out &&
 	test_cmp out expect &&
 	test_path_is_missing .git/MERGE_HEAD &&
@@ -164,7 +165,7 @@ test_expect_success 'set up unborn branch and content' '
 	echo bar > untracked-file
 '
 
-test_expect_failure 'will not clobber WT/index when merging into unborn' '
+test_expect_success 'will not clobber WT/index when merging into unborn' '
 	git merge master &&
 	grep foo tracked-file &&
 	git show :tracked-file >expect &&
-- 
1.7.4.33.gb8855.dirty
Previous: Jeff KingNext: Jeff King
Message 6 of 8 in “Why git silently replaces untracked files?”
  1. igor.mikushkinMar 25, 2011
  2. Jeff KingMar 25, 2011
  3. igor.mikushkinMar 25, 2011
  4. Jeff KingMar 25, 2011
  5. 1/4 t7607: mark known breakage in test 11 as fixedJeff King, Mar 25, 2011
  6. 2/4 t7607: clean up stray untracked fileJeff King, Mar 25, 2011
  7. 3/4 merge: merge unborn index before setting refJeff King, Mar 25, 2011
  8. 4/4 pull: do not clobber untracked files on initial pullJeff King, Mar 25, 2011

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.