All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Michael Blume <blume.mike@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: [PATCH] t1410: fix breakage on case-insensitive filesystems
Date: Sat, 8 Nov 2014 20:59:18 -0500	[thread overview]
Message-ID: <20141109015918.GA24736@peff.net> (raw)
In-Reply-To: <20141109014354.GA23883@peff.net>

On Sat, Nov 08, 2014 at 08:43:54PM -0500, Jeff King wrote:

> Unfortunately I don't have an OS X install handy to test on.

I lied; it turns out I still had access to an old VM. The problem did
turn out to be rather silly. Here's a patch.

-- >8 --
Two tests recently added to t1410 create branches "a" and
"a/b" to test d/f conflicts on reflogs. Earlier, unrelated
tests in that script create the path "A/B" in the working
tree.  There's no conflict on a case-sensitive filesystem,
but on a case-insensitive one, "git log" will complain that
"a/b" is both a revision and a working tree path.

We could fix this by using a "--" to disambiguate, but we
are probably better off using names that are less confusing
to make it more clear that they are unrelated to the working
tree files.  This patch turns "a/b" into "one/two".

Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
The line-diff is hard to read, but if anyone was looking for a chance to
test-drive contrib/diff-highlight, it does a good job of making the
change easy to see.

 t/t1410-reflog.sh | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 976c1d4..8cf4461 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -254,36 +254,36 @@ test_expect_success 'checkout should not delete log for packed ref' '
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
-	test_when_finished "git branch -d a || git branch -d a/b" &&
+	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch a/b master &&
-	echo "a/b@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a/b >actual &&
+	git branch one/two master &&
+	echo "one/two@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
-	git branch -d a/b &&
+	git branch -d one/two &&
 
-	# now logs/refs/heads/a is a stale directory, but
-	# we should move it out of the way to create "a" reflog
-	git branch a master &&
-	echo "a@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a >actual &&
+	# now logs/refs/heads/one is a stale directory, but
+	# we should move it out of the way to create "one" reflog
+	git branch one master &&
+	echo "one@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual
 '
 
 test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
-	test_when_finished "git branch -d a || git branch -d a/b" &&
+	test_when_finished "git branch -d one || git branch -d one/two" &&
 
-	git branch a/b master &&
-	echo "a/b@{0} branch: Created from master" >expect &&
-	git log -g --format="%gd %gs" a/b >actual &&
+	git branch one/two master &&
+	echo "one/two@{0} branch: Created from master" >expect &&
+	git log -g --format="%gd %gs" one/two >actual &&
 	test_cmp expect actual &&
-	git branch -d a/b &&
+	git branch -d one/two &&
 
-	# same as before, but we only create a reflog for "a" if
+	# same as before, but we only create a reflog for "one" if
 	# it already exists, which it does not
-	git -c core.logallrefupdates=false branch a master &&
+	git -c core.logallrefupdates=false branch one master &&
 	: >expect &&
-	git log -g --format="%gd %gs" a >actual &&
+	git log -g --format="%gd %gs" one >actual &&
 	test_cmp expect actual
 '
 
-- 
2.1.2.596.g7379948

  reply	other threads:[~2014-11-09  1:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-08 19:28 Test failure Michael Blume
2014-11-09  1:43 ` Jeff King
2014-11-09  1:59   ` Jeff King [this message]
2014-11-09 17:34     ` [PATCH] t1410: fix breakage on case-insensitive filesystems Michael Blume
2014-11-09 17:48       ` Junio C Hamano
2014-11-10  6:30         ` Jeff King
2014-11-10  6:47           ` Junio C Hamano
2014-11-10  7:04             ` Jeff King
2014-11-09 20:04       ` Torsten Bögershausen
2014-11-09 21:36         ` Michael Blume
2014-11-09 21:42           ` Torsten Bögershausen
2014-11-10  2:46             ` Michael Blume
2014-11-10  2:56     ` Junio C Hamano
2014-11-10  6:09       ` Jeff King
2014-11-12 20:20     ` Johannes Sixt
2014-11-12 21:59       ` Jeff King
2014-11-13  8:50         ` Johannes Sixt
2014-11-13  9:08           ` Jeff King
2014-11-13 16:30             ` Junio C Hamano
2014-11-14 19:11             ` Johannes Sixt
2014-11-14 19:23               ` Jeff King
2014-11-14 20:03               ` Junio C Hamano
2014-11-14 21:04               ` Andreas Schwab
2014-11-15  8:27                 ` Johannes Sixt
2014-11-16 21:06                   ` [PATCH v2] Windows: correct detection of EISDIR in mingw_open() Johannes Sixt
2014-11-09  5:44   ` Test failure Michael Blume

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=20141109015918.GA24736@peff.net \
    --to=peff@peff.net \
    --cc=blume.mike@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.