Skip to content

Commit eb10e63

Browse files
jeffhostetlergitster
authored andcommitted
p7519: do not rely on "xargs -d" in test
Convert the test to use a more portable method to update the mtime on a large number of files under version control. The Mac version of xargs does not support the "-d" option. Likewise, the "-0" and "--null" options are not portable. Furthermore, use `test-tool chmtime` rather than `touch` to update the mtime to ensure that it is actually updated (especially on file systems with only whole second resolution). Signed-off-by: Jeff Hostetler <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71ca53e commit eb10e63

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

t/perf/p7519-fsmonitor.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,18 @@ test_fsmonitor_suite() {
164164
git status -uall
165165
'
166166

167+
# Update the mtimes on upto 100k files to make status think
168+
# that they are dirty. For simplicity, omit any files with
169+
# LFs (i.e. anything that ls-files thinks it needs to dquote).
170+
# Then fully backslash-quote the paths to capture any
171+
# whitespace so that they pass thru xargs properly.
172+
#
167173
test_perf_w_drop_caches "status (dirty) ($DESC)" '
168-
git ls-files | head -100000 | xargs -d "\n" touch -h &&
174+
git ls-files | \
175+
head -100000 | \
176+
grep -v \" | \
177+
sed '\''s/\(.\)/\\\1/g'\'' | \
178+
xargs test-tool chmtime -300 &&
169179
git status
170180
'
171181

0 commit comments

Comments
 (0)