t/helper: merge test-chmtime into test-tool

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Mar 24, 2018 at 08:44 UTC 0e496492d26a8f7f360b6fad1aed2cae74403fa1
33 files changed +94 -89
Makefile
+2 -1
@@ -652,7 +652,8 @@ X =
652
653 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
654
655 -TEST_PROGRAMS_NEED_X += test-chmtime
655 +TEST_BUILTINS_OBJS += test-chmtime.o
656 +
657 TEST_PROGRAMS_NEED_X += test-ctype
658 TEST_PROGRAMS_NEED_X += test-config
659 TEST_PROGRAMS_NEED_X += test-date
t/helper/test-chmtime.c
+8 -7
@@ -5,28 +5,29 @@
5 *
6 * The mtime can be changed to an absolute value:
7 *
8 - * test-chmtime =<seconds> file...
8 + * test-tool chmtime =<seconds> file...
9 *
10 * Relative to the current time as returned by time(3):
11 *
12 - * test-chmtime =+<seconds> (or =-<seconds>) file...
12 + * test-tool chmtime =+<seconds> (or =-<seconds>) file...
13 *
14 * Or relative to the current mtime of the file:
15 *
16 - * test-chmtime <seconds> file...
17 - * test-chmtime +<seconds> (or -<seconds>) file...
16 + * test-tool chmtime <seconds> file...
17 + * test-tool chmtime +<seconds> (or -<seconds>) file...
18 *
19 * Examples:
20 *
21 * To just print the mtime use --verbose and set the file mtime offset to 0:
22 *
23 - * test-chmtime -v +0 file
23 + * test-tool chmtime -v +0 file
24 *
25 * To set the mtime to current time:
26 *
27 - * test-chmtime =+0 file
27 + * test-tool chmtime =+0 file
28 *
29 */
30 +#include "test-tool.h"
31 #include "git-compat-util.h"
32 #include <utime.h>
33
@@ -56,7 +57,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)
57 return 1;
58 }
59
59 -int cmd_main(int argc, const char **argv)
60 +int cmd__chmtime(int argc, const char **argv)
61 {
62 static int verbose;
63
t/helper/test-tool.c
+1
@@ -7,6 +7,7 @@ struct test_cmd {
7 };
8
9 static struct test_cmd cmds[] = {
10 + { "chmtime", cmd__chmtime },
11 };
12
13 int cmd_main(int argc, const char **argv)
t/helper/test-tool.h
+2
@@ -1,4 +1,6 @@
1 #ifndef __TEST_TOOL_H__
2 #define __TEST_TOOL_H__
3
4 +int cmd__chmtime(int argc, const char **argv);
5 +
6 #endif
t/lib-git-svn.sh
+1 -1
@@ -49,7 +49,7 @@ rawsvnrepo="$svnrepo"
49 svnrepo="file://$svnrepo"
50
51 poke() {
52 - test-chmtime +1 "$1"
52 + test-tool chmtime +1 "$1"
53 }
54
55 # We need this, because we should pass empty configuration directory to
t/t1700-split-index.sh
+6 -6
@@ -332,12 +332,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '
332 git update-index --add ten &&
333 test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
334 just_under_2_weeks_ago=$((5-14*86400)) &&
335 - test-chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&
335 + test-tool chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&
336 : >eleven &&
337 git update-index --add eleven &&
338 test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
339 just_over_2_weeks_ago=$((-1-14*86400)) &&
340 - test-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
340 + test-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
341 : >twelve &&
342 git update-index --add twelve &&
343 test $(ls .git/sharedindex.* | wc -l) -le 2
@@ -345,12 +345,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '
345
346 test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '
347 git config splitIndex.sharedIndexExpire "16.days.ago" &&
348 - test-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
348 + test-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
349 : >thirteen &&
350 git update-index --add thirteen &&
351 test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
352 just_over_16_days_ago=$((-1-16*86400)) &&
353 - test-chmtime =$just_over_16_days_ago .git/sharedindex.* &&
353 + test-tool chmtime =$just_over_16_days_ago .git/sharedindex.* &&
354 : >fourteen &&
355 git update-index --add fourteen &&
356 test $(ls .git/sharedindex.* | wc -l) -le 2
@@ -359,13 +359,13 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '
359 test_expect_success 'check splitIndex.sharedIndexExpire set to "never" and "now"' '
360 git config splitIndex.sharedIndexExpire never &&
361 just_10_years_ago=$((-365*10*86400)) &&
362 - test-chmtime =$just_10_years_ago .git/sharedindex.* &&
362 + test-tool chmtime =$just_10_years_ago .git/sharedindex.* &&
363 : >fifteen &&
364 git update-index --add fifteen &&
365 test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
366 git config splitIndex.sharedIndexExpire now &&
367 just_1_second_ago=-1 &&
368 - test-chmtime =$just_1_second_ago .git/sharedindex.* &&
368 + test-tool chmtime =$just_1_second_ago .git/sharedindex.* &&
369 : >sixteen &&
370 git update-index --add sixteen &&
371 test $(ls .git/sharedindex.* | wc -l) -le 2
t/t2022-checkout-paths.sh
+2 -2
@@ -68,13 +68,13 @@ test_expect_success 'do not touch files that are already up-to-date' '
68 git add file1 file2 &&
69 git commit -m base &&
70 echo modified >file1 &&
71 - test-chmtime =1000000000 file2 &&
71 + test-tool chmtime =1000000000 file2 &&
72 git update-index -q --refresh &&
73 git checkout HEAD -- file1 file2 &&
74 echo one >expect &&
75 test_cmp expect file1 &&
76 echo "1000000000 file2" >expect &&
77 - test-chmtime -v +0 file2 >actual &&
77 + test-tool chmtime -v +0 file2 >actual &&
78 test_cmp expect actual
79 '
80
t/t3306-notes-prune.sh
+1 -1
@@ -22,7 +22,7 @@ test_expect_success 'setup: create a few commits with notes' '
22 git commit -m 3rd &&
23 COMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
24 test -f $COMMIT_FILE &&
25 - test-chmtime =+0 $COMMIT_FILE &&
25 + test-tool chmtime =+0 $COMMIT_FILE &&
26 git notes add -m "Note #3"
27 '
28
t/t3404-rebase-interactive.sh
+2 -2
@@ -711,13 +711,13 @@ test_expect_success 'rebase -i continue with unstaged submodule' '
711 test_expect_success 'avoid unnecessary reset' '
712 git checkout master &&
713 git reset --hard &&
714 - test-chmtime =123456789 file3 &&
714 + test-tool chmtime =123456789 file3 &&
715 git update-index --refresh &&
716 HEAD=$(git rev-parse HEAD) &&
717 set_fake_editor &&
718 git rebase -i HEAD~4 &&
719 test $HEAD = $(git rev-parse HEAD) &&
720 - MTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&
720 + MTIME=$(test-tool chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&
721 test 123456789 = $MTIME
722 '
723
t/t3418-rebase-continue.sh
+2 -2
@@ -24,7 +24,7 @@ test_expect_success 'interactive rebase --continue works with touched file' '
24 git checkout master &&
25
26 FAKE_LINES="edit 1" git rebase -i HEAD^ &&
27 - test-chmtime =-60 F1 &&
27 + test-tool chmtime =-60 F1 &&
28 git rebase --continue
29 '
30
@@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file'
36 test_must_fail git rebase --onto master master topic &&
37 echo "Resolved" >F2 &&
38 git add F2 &&
39 - test-chmtime =-60 F1 &&
39 + test-tool chmtime =-60 F1 &&
40 git rebase --continue
41 '
42
t/t3501-revert-cherry-pick.sh
+1 -1
@@ -86,7 +86,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
86 (
87 cd copy &&
88 git checkout initial &&
89 - test-chmtime +40 oops &&
89 + test-tool chmtime +40 oops &&
90 git cherry-pick added
91 )
92 '
t/t3510-cherry-pick-sequence.sh
+2 -2
@@ -247,9 +247,9 @@ test_expect_success '--abort after last commit in sequence' '
247 test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '
248 pristine_detach initial &&
249 test_expect_code 1 git cherry-pick base..anotherpick &&
250 - test-chmtime -v +0 .git/sequencer >expect &&
250 + test-tool chmtime -v +0 .git/sequencer >expect &&
251 test_expect_code 128 git cherry-pick unrelatedpick &&
252 - test-chmtime -v +0 .git/sequencer >actual &&
252 + test-tool chmtime -v +0 .git/sequencer >actual &&
253 test_cmp expect actual
254 '
255
t/t3600-rm.sh
+1 -1
@@ -232,7 +232,7 @@ test_expect_success 'Call "rm" from outside the work tree' '
232 test_expect_success 'refresh index before checking if it is up-to-date' '
233
234 git reset --hard &&
235 - test-chmtime -86400 frotz/nitfol &&
235 + test-tool chmtime -86400 frotz/nitfol &&
236 git rm frotz/nitfol &&
237 test ! -f frotz/nitfol
238
t/t3700-add.sh
+1 -1
@@ -187,7 +187,7 @@ test_expect_success 'git add --refresh with pathspec' '
187 echo >foo && echo >bar && echo >baz &&
188 git add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&
189 echo "100644 $H 3 foo" | git update-index --index-info &&
190 - test-chmtime -60 bar baz &&
190 + test-tool chmtime -60 bar baz &&
191 >expect &&
192 git add --refresh bar >actual &&
193 test_cmp expect actual &&
t/t4011-diff-symlink.sh
+1 -1
@@ -73,7 +73,7 @@ test_expect_success 'diff identical, but newly created symlink and file' '
73 >expected &&
74 rm -f frotz nitfol &&
75 echo xyzzy >nitfol &&
76 - test-chmtime +10 nitfol &&
76 + test-tool chmtime +10 nitfol &&
77 if test_have_prereq SYMLINKS
78 then
79 ln -s xyzzy frotz
t/t4013-diff-various.sh
+1 -1
@@ -76,7 +76,7 @@ test_expect_success setup '
76
77 mkdir dir3 &&
78 cp dir/sub dir3/sub &&
79 - test-chmtime +1 dir3/sub &&
79 + test-tool chmtime +1 dir3/sub &&
80
81 git config log.showroot false &&
82 git commit --amend &&
t/t4035-diff-quiet.sh
+1 -1
@@ -147,7 +147,7 @@ test_expect_success 'git diff --ignore-all-space, both files outside repo' '
147 '
148
149 test_expect_success 'git diff --quiet ignores stat-change only entries' '
150 - test-chmtime +10 a &&
150 + test-tool chmtime +10 a &&
151 echo modified >>b &&
152 test_expect_code 1 git diff --quiet
153 '
t/t4151-am-abort.sh
+2 -2
@@ -171,7 +171,7 @@ test_expect_success 'am --skip leaves index stat info alone' '
171 git checkout -f --orphan skip-stat-info &&
172 git reset &&
173 test_commit skip-should-be-untouched &&
174 - test-chmtime =0 skip-should-be-untouched.t &&
174 + test-tool chmtime =0 skip-should-be-untouched.t &&
175 git update-index --refresh &&
176 git diff-files --exit-code --quiet &&
177 test_must_fail git am 0001-*.patch &&
@@ -183,7 +183,7 @@ test_expect_success 'am --abort leaves index stat info alone' '
183 git checkout -f --orphan abort-stat-info &&
184 git reset &&
185 test_commit abort-should-be-untouched &&
186 - test-chmtime =0 abort-should-be-untouched.t &&
186 + test-tool chmtime =0 abort-should-be-untouched.t &&
187 git update-index --refresh &&
188 git diff-files --exit-code --quiet &&
189 test_must_fail git am 0001-*.patch &&
t/t4200-rerere.sh
+11 -11
@@ -166,7 +166,7 @@ test_expect_success 'first postimage wins' '
166 git commit -q -a -m "prefer first over second" &&
167 test -f $rr/postimage &&
168
169 - oldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&
169 + oldmtimepost=$(test-tool chmtime -v -60 $rr/postimage | cut -f 1) &&
170
171 git checkout -b third master &&
172 git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
@@ -179,7 +179,7 @@ test_expect_success 'first postimage wins' '
179 '
180
181 test_expect_success 'rerere updates postimage timestamp' '
182 - newmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&
182 + newmtimepost=$(test-tool chmtime -v +0 $rr/postimage | cut -f 1) &&
183 test $oldmtimepost -lt $newmtimepost
184 '
185
@@ -220,9 +220,9 @@ test_expect_success 'set up for garbage collection tests' '
220 almost_60_days_ago=$((60-60*86400)) &&
221 just_over_60_days_ago=$((-1-60*86400)) &&
222
223 - test-chmtime =$just_over_60_days_ago $rr/preimage &&
224 - test-chmtime =$almost_60_days_ago $rr/postimage &&
225 - test-chmtime =$almost_15_days_ago $rr2/preimage
223 + test-tool chmtime =$just_over_60_days_ago $rr/preimage &&
224 + test-tool chmtime =$almost_60_days_ago $rr/postimage &&
225 + test-tool chmtime =$almost_15_days_ago $rr2/preimage
226 '
227
228 test_expect_success 'gc preserves young or recently used records' '
@@ -232,8 +232,8 @@ test_expect_success 'gc preserves young or recently used records' '
232 '
233
234 test_expect_success 'old records rest in peace' '
235 - test-chmtime =$just_over_60_days_ago $rr/postimage &&
236 - test-chmtime =$just_over_15_days_ago $rr2/preimage &&
235 + test-tool chmtime =$just_over_60_days_ago $rr/postimage &&
236 + test-tool chmtime =$just_over_15_days_ago $rr2/preimage &&
237 git rerere gc &&
238 ! test -f $rr/preimage &&
239 ! test -f $rr2/preimage
@@ -249,8 +249,8 @@ rerere_gc_custom_expiry_test () {
249 >"$rr/postimage" &&
250
251 two_days_ago=$((-2*86400)) &&
252 - test-chmtime =$two_days_ago "$rr/preimage" &&
253 - test-chmtime =$two_days_ago "$rr/postimage" &&
252 + test-tool chmtime =$two_days_ago "$rr/preimage" &&
253 + test-tool chmtime =$two_days_ago "$rr/postimage" &&
254
255 find .git/rr-cache -type f | sort >original &&
256
@@ -512,7 +512,7 @@ test_expect_success 'multiple identical conflicts' '
512 count_pre_post 2 0 &&
513
514 # Pretend that the conflicts were made quite some time ago
515 - find .git/rr-cache/ -type f | xargs test-chmtime -172800 &&
515 + find .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&
516
517 # Unresolved entries have not expired yet
518 git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
@@ -568,7 +568,7 @@ test_expect_success 'multiple identical conflicts' '
568 git rerere &&
569
570 # Pretend that the resolutions are old again
571 - find .git/rr-cache/ -type f | xargs test-chmtime -172800 &&
571 + find .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&
572
573 # Resolved entries have not expired yet
574 git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
t/t5000-tar-tree.sh
+1 -1
@@ -192,7 +192,7 @@ test_expect_success \
192 'validate file modification time' \
193 'mkdir extract &&
194 "$TAR" xf b.tar -C extract a/a &&
195 - test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
195 + test-tool chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
196 echo "1117231200" >expected.mtime &&
197 test_cmp expected.mtime b.mtime'
198
t/t5304-prune.sh
+8 -8
@@ -15,7 +15,7 @@ add_blob() {
15 BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
16 verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
17 test_path_is_file $BLOB_FILE &&
18 - test-chmtime =+0 $BLOB_FILE
18 + test-tool chmtime =+0 $BLOB_FILE
19 }
20
21 test_expect_success setup '
@@ -33,7 +33,7 @@ test_expect_success 'prune stale packs' '
33 orig_pack=$(echo .git/objects/pack/*.pack) &&
34 : > .git/objects/tmp_1.pack &&
35 : > .git/objects/tmp_2.pack &&
36 - test-chmtime =-86501 .git/objects/tmp_1.pack &&
36 + test-tool chmtime =-86501 .git/objects/tmp_1.pack &&
37 git prune --expire 1.day &&
38 test_path_is_file $orig_pack &&
39 test_path_is_file .git/objects/tmp_2.pack &&
@@ -47,7 +47,7 @@ test_expect_success 'prune --expire' '
47 git prune --expire=1.hour.ago &&
48 verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
49 test_path_is_file $BLOB_FILE &&
50 - test-chmtime =-86500 $BLOB_FILE &&
50 + test-tool chmtime =-86500 $BLOB_FILE &&
51 git prune --expire 1.day &&
52 verbose test $before = $(git count-objects | sed "s/ .*//") &&
53 test_path_is_missing $BLOB_FILE
@@ -57,11 +57,11 @@ test_expect_success 'prune --expire' '
57 test_expect_success 'gc: implicit prune --expire' '
58
59 add_blob &&
60 - test-chmtime =-$((2*$week-30)) $BLOB_FILE &&
60 + test-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&
61 git gc &&
62 verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
63 test_path_is_file $BLOB_FILE &&
64 - test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
64 + test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
65 git gc &&
66 verbose test $before = $(git count-objects | sed "s/ .*//") &&
67 test_path_is_missing $BLOB_FILE
@@ -141,7 +141,7 @@ test_expect_success 'prune: do not prune heads listed as an argument' '
141 test_expect_success 'gc --no-prune' '
142
143 add_blob &&
144 - test-chmtime =-$((5001*$day)) $BLOB_FILE &&
144 + test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
145 git config gc.pruneExpire 2.days.ago &&
146 git gc --no-prune &&
147 verbose test 1 = $(git count-objects | sed "s/ .*//") &&
@@ -163,7 +163,7 @@ test_expect_success 'gc respects gc.pruneExpire' '
163 test_expect_success 'gc --prune=<date>' '
164
165 add_blob &&
166 - test-chmtime =-$((5001*$day)) $BLOB_FILE &&
166 + test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
167 git gc --prune=5002.days.ago &&
168 test_path_is_file $BLOB_FILE &&
169 git gc --prune=5000.days.ago &&
@@ -205,7 +205,7 @@ test_expect_success 'prune --expire=never' '
205
206 test_expect_success 'gc: prune old objects after local clone' '
207 add_blob &&
208 - test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
208 + test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
209 git clone --no-hardlinks . aclone &&
210 (
211 cd aclone &&
t/t5400-send-pack.sh
+1 -1
@@ -180,7 +180,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
180 # And create a file that follows the temporary object naming
181 # convention for the auto-gc to remove
182 : >.git/objects/tmp_test_object &&
183 - test-chmtime =-1209601 .git/objects/tmp_test_object
183 + test-tool chmtime =-1209601 .git/objects/tmp_test_object
184 ) &&
185 (
186 cd parent &&
t/t5516-fetch-push.sh
+1 -1
@@ -1418,7 +1418,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
1418 cd testrepo &&
1419 git reset --hard HEAD^ &&
1420 test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
1421 - test-chmtime +100 path1
1421 + test-tool chmtime +100 path1
1422 ) &&
1423 git push testrepo master &&
1424 (
t/t6022-merge-rename.sh
+15 -15
@@ -635,10 +635,10 @@ test_expect_success 'setup avoid unnecessary update, normal rename' '
635
636 test_expect_success 'avoid unnecessary update, normal rename' '
637 git checkout -q avoid-unnecessary-update-1^0 &&
638 - test-chmtime =1000000000 rename &&
639 - test-chmtime -v +0 rename >expect &&
638 + test-tool chmtime =1000000000 rename &&
639 + test-tool chmtime -v +0 rename >expect &&
640 git merge merge-branch-1 &&
641 - test-chmtime -v +0 rename >actual &&
641 + test-tool chmtime -v +0 rename >actual &&
642 test_cmp expect actual # "rename" should have stayed intact
643 '
644
@@ -668,10 +668,10 @@ test_expect_success 'setup to test avoiding unnecessary update, with D/F conflic
668
669 test_expect_success 'avoid unnecessary update, with D/F conflict' '
670 git checkout -q avoid-unnecessary-update-2^0 &&
671 - test-chmtime =1000000000 df &&
672 - test-chmtime -v +0 df >expect &&
671 + test-tool chmtime =1000000000 df &&
672 + test-tool chmtime -v +0 df >expect &&
673 git merge merge-branch-2 &&
674 - test-chmtime -v +0 df >actual &&
674 + test-tool chmtime -v +0 df >actual &&
675 test_cmp expect actual # "df" should have stayed intact
676 '
677
@@ -700,10 +700,10 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
700
701 test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
702 git checkout -q master^0 &&
703 - test-chmtime =1000000000 df &&
704 - test-chmtime -v +0 df >expect &&
703 + test-tool chmtime =1000000000 df &&
704 + test-tool chmtime -v +0 df >expect &&
705 git merge side &&
706 - test-chmtime -v +0 df >actual &&
706 + test-tool chmtime -v +0 df >actual &&
707 test_cmp expect actual # "df" should have stayed intact
708 '
709
@@ -730,10 +730,10 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
730
731 test_expect_success 'avoid unnecessary update, modify/delete' '
732 git checkout -q master^0 &&
733 - test-chmtime =1000000000 file &&
734 - test-chmtime -v +0 file >expect &&
733 + test-tool chmtime =1000000000 file &&
734 + test-tool chmtime -v +0 file >expect &&
735 test_must_fail git merge side &&
736 - test-chmtime -v +0 file >actual &&
736 + test-tool chmtime -v +0 file >actual &&
737 test_cmp expect actual # "file" should have stayed intact
738 '
739
@@ -759,10 +759,10 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
759
760 test_expect_success 'avoid unnecessary update, rename/add-dest' '
761 git checkout -q master^0 &&
762 - test-chmtime =1000000000 newfile &&
763 - test-chmtime -v +0 newfile >expect &&
762 + test-tool chmtime =1000000000 newfile &&
763 + test-tool chmtime -v +0 newfile >expect &&
764 git merge side &&
765 - test-chmtime -v +0 newfile >actual &&
765 + test-tool chmtime -v +0 newfile >actual &&
766 test_cmp expect actual # "file" should have stayed intact
767 '
768
t/t6500-gc.sh
+1 -1
@@ -87,7 +87,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re
87 test_must_fail git gc --auto 2>err &&
88 test_i18ngrep "^error:" err &&
89 test_config gc.logexpiry 5.days &&
90 - test-chmtime =-345600 .git/gc.log &&
90 + test-tool chmtime =-345600 .git/gc.log &&
91 test_must_fail git gc --auto &&
92 test_config gc.logexpiry 2.days &&
93 run_and_wait_for_auto_gc &&
t/t6501-freshen-objects.sh
+2 -2
@@ -73,7 +73,7 @@ for repack in '' true; do
73
74 test_expect_success "simulate time passing ($title)" '
75 find .git/objects -type f |
76 - xargs test-chmtime -v -86400
76 + xargs test-tool chmtime -v -86400
77 '
78
79 test_expect_success "start writing new commit with old blob ($title)" '
@@ -104,7 +104,7 @@ for repack in '' true; do
104 test_expect_success "abandon objects again ($title)" '
105 git reset --hard HEAD^ &&
106 find .git/objects -type f |
107 - xargs test-chmtime -v -86400
107 + xargs test-tool chmtime -v -86400
108 '
109
110 test_expect_success "start writing new commit with same tree ($title)" '
t/t7508-status.sh
+3 -3
@@ -1672,12 +1672,12 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
1672 '
1673
1674 test_expect_success '--no-optional-locks prevents index update' '
1675 - test-chmtime =1234567890 .git/index &&
1675 + test-tool chmtime =1234567890 .git/index &&
1676 git --no-optional-locks status &&
1677 - test-chmtime -v +0 .git/index >out &&
1677 + test-tool chmtime -v +0 .git/index >out &&
1678 grep ^1234567890 out &&
1679 git status &&
1680 - test-chmtime -v +0 .git/index >out &&
1680 + test-tool chmtime -v +0 .git/index >out &&
1681 ! grep ^1234567890 out
1682 '
1683
t/t7701-repack-unpack-unreachable.sh
+3 -3
@@ -90,7 +90,7 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '
90 tmppack=".git/objects/pack/tmp_pack" &&
91 ln "$packfile" "$tmppack" &&
92 git repack -A -l -d &&
93 - test-chmtime -v +0 "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" \
93 + test-tool chmtime -v +0 "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" \
94 > mtimes &&
95 compare_mtimes < mtimes
96 '
@@ -103,7 +103,7 @@ test_expect_success 'do not bother loosening old objects' '
103 git prune-packed &&
104 git cat-file -p $obj1 &&
105 git cat-file -p $obj2 &&
106 - test-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
106 + test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
107 git repack -A -d --unpack-unreachable=1.hour.ago &&
108 git cat-file -p $obj1 &&
109 test_must_fail git cat-file -p $obj2
@@ -117,7 +117,7 @@ test_expect_success 'keep packed objects found only in index' '
117 git reset HEAD^ &&
118 git reflog expire --expire=now --all &&
119 git add file &&
120 - test-chmtime =-86400 .git/objects/pack/* &&
120 + test-tool chmtime =-86400 .git/objects/pack/* &&
121 git gc --prune=1.hour.ago &&
122 git cat-file blob :file
123 '
t/t9100-git-svn-basic.sh
+2 -2
@@ -288,12 +288,12 @@ test_expect_success 'able to dcommit to a subdirectory' '
288
289 test_expect_success 'dcommit should not fail with a touched file' '
290 test_commit "commit-new-file-foo2" foo2 &&
291 - test-chmtime =-60 foo &&
291 + test-tool chmtime =-60 foo &&
292 git svn dcommit
293 '
294
295 test_expect_success 'rebase should not fail with a touched file' '
296 - test-chmtime =-60 foo &&
296 + test-tool chmtime =-60 foo &&
297 git svn rebase
298 '
299
t/t9803-git-p4-shell-metachars.sh
+2 -2
@@ -28,7 +28,7 @@ test_expect_success 'shell metachars in filenames' '
28 echo f2 >"file with spaces" &&
29 git add "file with spaces" &&
30 git commit -m "add files" &&
31 - P4EDITOR="test-chmtime +5" git p4 submit
31 + P4EDITOR="test-tool chmtime +5" git p4 submit
32 ) &&
33 (
34 cd "$cli" &&
@@ -47,7 +47,7 @@ test_expect_success 'deleting with shell metachars' '
47 git rm foo\$bar &&
48 git rm file\ with\ spaces &&
49 git commit -m "remove files" &&
50 - P4EDITOR="test-chmtime +5" git p4 submit
50 + P4EDITOR="test-tool chmtime +5" git p4 submit
51 ) &&
52 (
53 cd "$cli" &&
t/t9813-git-p4-preserve-users.sh
+3 -3
@@ -53,7 +53,7 @@ test_expect_success 'preserve users' '
53 git commit --author "Alice <alice@example.com>" -m "a change by alice" file1 &&
54 git commit --author "Bob <bob@example.com>" -m "a change by bob" file2 &&
55 git config git-p4.skipSubmitEditCheck true &&
56 - P4EDITOR="test-chmtime +5" P4USER=alice P4PASSWD=secret &&
56 + P4EDITOR="test-tool chmtime +5" P4USER=alice P4PASSWD=secret &&
57 export P4EDITOR P4USER P4PASSWD &&
58 git p4 commit --preserve-user &&
59 p4_check_commit_author file1 alice &&
@@ -71,7 +71,7 @@ test_expect_success 'refuse to preserve users without perms' '
71 git config git-p4.skipSubmitEditCheck true &&
72 echo "username-noperms: a change by alice" >>file1 &&
73 git commit --author "Alice <alice@example.com>" -m "perms: a change by alice" file1 &&
74 - P4EDITOR="test-chmtime +5" P4USER=bob P4PASSWD=secret &&
74 + P4EDITOR="test-tool chmtime +5" P4USER=bob P4PASSWD=secret &&
75 export P4EDITOR P4USER P4PASSWD &&
76 test_must_fail git p4 commit --preserve-user &&
77 ! git diff --exit-code HEAD..p4/master
@@ -89,7 +89,7 @@ test_expect_success 'preserve user where author is unknown to p4' '
89 git commit --author "Bob <bob@example.com>" -m "preserve: a change by bob" file1 &&
90 echo "username-unknown: a change by charlie" >>file1 &&
91 git commit --author "Charlie <charlie@example.com>" -m "preserve: a change by charlie" file1 &&
92 - P4EDITOR="test-chmtime +5" P4USER=alice P4PASSWD=secret &&
92 + P4EDITOR="test-tool chmtime +5" P4USER=alice P4PASSWD=secret &&
93 export P4EDITOR P4USER P4PASSWD &&
94 test_must_fail git p4 commit --preserve-user &&
95 ! git diff --exit-code HEAD..p4/master &&
t/t9820-git-p4-editor-handling.sh
+1 -1
@@ -26,7 +26,7 @@ test_expect_success 'EDITOR with options' '
26 cd "$git" &&
27 echo change >file1 &&
28 git commit -m "change" file1 &&
29 - P4EDITOR=": >\"$git/touched\" && test-chmtime +5" git p4 submit &&
29 + P4EDITOR=": >\"$git/touched\" && test-tool chmtime +5" git p4 submit &&
30 test_path_is_file "$git/touched"
31 )
32 '
t/test-lib.sh
+3 -3
@@ -963,10 +963,10 @@ test -d "$GIT_BUILD_DIR"/templates/blt || {
963 error "You haven't built things yet, have you?"
964 }
965
966 -if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime
966 +if ! test -x "$GIT_BUILD_DIR"/t/helper/test-tool
967 then
968 - echo >&2 'You need to build test-chmtime:'
969 - echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory'
968 + echo >&2 'You need to build test-tool:'
969 + echo >&2 'Run "make t/helper/test-tool" in the source (toplevel) directory'
970 exit 1
971 fi
972