git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t0021: make sure clean filter runs
@ 2019-08-20  6:56 Thomas Gummerer
  2019-08-20 18:01 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Thomas Gummerer @ 2019-08-20  6:56 UTC (permalink / raw)
  To: git
  Cc: rsbecker, johannes.schindelin, larsxschneider, szeder.dev,
	Thomas Gummerer

In t0021.15 one of the things we are checking is that the clean filter
is run when checking out empty-branch.  The clean filter needs to be
run to make sure there are no modifications on the file system for the
test.r file, and thus it isn't dangerous to overwrite it.

However in the current test setup it is not always necessary to run
the clean filter, and thus the test sometimes fails, as debug.log
isn't written.

This happens when test.r has an older mtime than the index itself.
That mtime is also recorded as stat data for test.r in the index, and
based on the heuristic we're using for index entries, git correctly
assumes this file is up-to-date.

Usually this test succeeds because the mtime of test.r is the same as
the mtime of the index.  In this case test.r is racily clean, so git
actually checks the contents, for which the clean filter is run.

Fix the test by updating the mtime of test.r, so git is forced to
check the contents of the file, and the clean filter is run as the
test expects.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---
 t/t0021-conversion.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index e10f5f787f..66f75005d5 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -390,6 +390,7 @@ test_expect_success PERL 'required process filter should filter data' '
 		EOF
 		test_cmp_exclude_clean expected.log debug.log &&
 
+		touch test.r &&
 		filter_git checkout --quiet --no-progress empty-branch &&
 		cat >expected.log <<-EOF &&
 			START
-- 
2.23.0.rc2.194.ge5444969c9


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-08-23  8:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20  6:56 [PATCH] t0021: make sure clean filter runs Thomas Gummerer
2019-08-20 18:01 ` Junio C Hamano
2019-08-21 14:52   ` Thomas Gummerer
2019-08-21 15:40     ` Junio C Hamano
2019-08-20 19:11 ` Johannes Sixt
2019-08-21 14:56   ` Thomas Gummerer
2019-08-21 18:23     ` Johannes Sixt
2019-08-21 22:03       ` SZEDER Gábor
2019-08-22 17:49         ` Thomas Gummerer
2019-08-22 18:04           ` Junio C Hamano
2019-08-22 18:52           ` Johannes Sixt
2019-08-22 19:22 ` [PATCH v2] " Thomas Gummerer
2019-08-22 20:01   ` Junio C Hamano
2019-08-23  8:34   ` SZEDER Gábor

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).