Re: [PATCH] Use "-f" when adding files with odd names in t9200.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brian Gernhardt <benji@xxxxxxxxxxxxxxxxxx> writes:

> I really think the patch is useful and allows the test to pass even on
> systems with idiotic filesystems and doesn't make it vulnerable to
> any bugs in cvsexportcommit.  (Bugs in git-add, maybe, but that's not
> what it's testing.)

In reality, I find highly valuable that our tests find new bugs
introduced in unexpected places.  I agree that the person who
wrote t9200 did not _mean_ to test "git add", but it ended up
helping us identify the problematic behaviour between creat()
and readdir() on HFS+ affects "git add".

We at least know that the test as written has a problem in an
environment where "touch '$p'; ls | fgrep '$p'" fails, and have
a clear understand why it fails.  I think that knowledge is
valuable -- adding '-f' to the test may hide potential problems
we might have with "git add" in other environments.

So how about doing this instead?  It tests if the filesystem has
that particular issue we know "git add" has a problem with, and
skips the test in such an environment.

---

 t/t9200-git-cvsexportcommit.sh |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index c443f32..4efa0c9 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -169,6 +169,16 @@ test_expect_success \
       test "$(echo $(sort "G g/CVS/Entries"|cut -d/ -f2,3,5))" = "with spaces.png/1.2/-kb with spaces.txt/1.2/"
       )'
 
+# Some filesystems mangle pathnames with UTF-8 characters --
+# check and skip
+if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" &&
+	mkdir -p "tst/$p" &&
+	date >"tst/$p/day" &&
+	found=$(find tst -type f -print) &&
+	test "z$found" = "ztst/$p/day" &&
+	rm -fr tst
+then
+
 # This test contains UTF-8 characters
 test_expect_success \
      'File with non-ascii file name' \
@@ -184,6 +194,10 @@ test_expect_success \
       test "$(echo $(sort Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/CVS/Entries|cut -d/ -f2,3,5))" = "gårdetsågårdet.png/1.1/-kb gårdetsågårdet.txt/1.1/"
       )'
 
+fi
+
+rm -fr tst
+
 test_expect_success \
      'Mismatching patch should fail' \
      'date >>"E/newfile5.txt" &&

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]