git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <johannes.sixt@telecom.at>
To: git@vger.kernel.org, j.sixt@eudaptics.com
Cc: Johannes Sixt <johannes.sixt@telecom.at>
Subject: [PATCH] Test that git add removes stages 1,2,3.
Date: Mon,  2 Jul 2007 13:18:06 +0200	[thread overview]
Message-ID: <11833750863127-git-send-email-johannes.sixt@telecom.at> (raw)

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
git add seems to have a bug, where it doesn't remove stages 1,2,3
if a stage 0 entry is already in the index.

Here is a test (on top of maint) for the kind soul who wants to fix
this border case.  Feel free to merge this patch into your patch
that provides the fix.

-- 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..d7dd6ca 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 &&
+	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

             reply	other threads:[~2007-07-02 11:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-02 11:18 Johannes Sixt [this message]
2007-07-02 11:23 ` [PATCH/amend] Test that git add removes stages 1,2,3 Johannes Sixt
2007-07-02 11:34 ` [PATCH] " Johannes Schindelin
2007-07-02 11:47   ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11833750863127-git-send-email-johannes.sixt@telecom.at \
    --to=johannes.sixt@telecom.at \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@eudaptics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).