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

[PATCH/amend] Test that git add removes stages 1,2,3.

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Jul 2, 2007, 11:23 UTC
Message-ID
<1183375431711-git-send-email-johannes.sixt@telecom.at>
In-Reply-To
<11833750863127-git-send-email-johannes.sixt@telecom.at>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
HMPF!
The test in the original post failed for the wrong reason. :-/
-- Hannes
 t/t3700-add.sh |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index ad8cc7d..06fc2bf 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -110,4 +110,16 @@ test_expect_success 'check correct prefix detection' '
 	git add 1/2/a 1/3/b 1/2/c
 '
 
+test_expect_success 'git add removes unmerged entries' '
+	git rm --cached -f file || : ignore failure &&
+	for s in 0 1 2 3
+	do
+		echo "100644 0123456789012345678901234567890123456789 $s	file"
+	done | git update-index --index-info &&
+	echo new > file &&
+	git add file &&
+	git ls-files --stage | grep "^100644 .* 0	file$" &&
+	! git ls-files --stage | grep "^100644 .* [^0]	file$"
+'
+
 test_done
-- 
1.5.2.2.555.g24e57
Previous: Johannes SixtNext: Johannes Schindelin
Message 2 of 4 in “Test that git add removes stages 1,2,3.”
  1. Test that git add removes stages 1,2,3.Johannes Sixt, Jul 2, 2007
  2. Test that git add removes stages 1,2,3.Johannes Sixt, Jul 2, 2007
  3. Johannes SchindelinJul 2, 2007
  4. Johannes SixtJul 2, 2007

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.