]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/helper: merge test-chmtime into test-tool
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 24 Mar 2018 07:44:31 +0000 (08:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Mar 2018 15:45:47 +0000 (08:45 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
33 files changed:
Makefile
t/helper/test-chmtime.c
t/helper/test-tool.c
t/helper/test-tool.h
t/lib-git-svn.sh
t/t1700-split-index.sh
t/t2022-checkout-paths.sh
t/t3306-notes-prune.sh
t/t3404-rebase-interactive.sh
t/t3418-rebase-continue.sh
t/t3501-revert-cherry-pick.sh
t/t3510-cherry-pick-sequence.sh
t/t3600-rm.sh
t/t3700-add.sh
t/t4011-diff-symlink.sh
t/t4013-diff-various.sh
t/t4035-diff-quiet.sh
t/t4151-am-abort.sh
t/t4200-rerere.sh
t/t5000-tar-tree.sh
t/t5304-prune.sh
t/t5400-send-pack.sh
t/t5516-fetch-push.sh
t/t6022-merge-rename.sh
t/t6500-gc.sh
t/t6501-freshen-objects.sh
t/t7508-status.sh
t/t7701-repack-unpack-unreachable.sh
t/t9100-git-svn-basic.sh
t/t9803-git-p4-shell-metachars.sh
t/t9813-git-p4-preserve-users.sh
t/t9820-git-p4-editor-handling.sh
t/test-lib.sh

index 2376646e98f18bca40f5d2503f6aa4ffaaf54679..416a8e39c1d636f0597f3c3a3cc642714ef13aa1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -652,7 +652,8 @@ X =
 
 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
 
-TEST_PROGRAMS_NEED_X += test-chmtime
+TEST_BUILTINS_OBJS += test-chmtime.o
+
 TEST_PROGRAMS_NEED_X += test-ctype
 TEST_PROGRAMS_NEED_X += test-config
 TEST_PROGRAMS_NEED_X += test-date
index e760256406fa9c2fe0f9b2cde0ffb97ff11c6cab..1790ceab510d53182225d3a28bbd4b4ef51abcdd 100644 (file)
@@ -5,28 +5,29 @@
  *
  * The mtime can be changed to an absolute value:
  *
- *     test-chmtime =<seconds> file...
+ *     test-tool chmtime =<seconds> file...
  *
  * Relative to the current time as returned by time(3):
  *
- *     test-chmtime =+<seconds> (or =-<seconds>) file...
+ *     test-tool chmtime =+<seconds> (or =-<seconds>) file...
  *
  * Or relative to the current mtime of the file:
  *
- *     test-chmtime <seconds> file...
- *     test-chmtime +<seconds> (or -<seconds>) file...
+ *     test-tool chmtime <seconds> file...
+ *     test-tool chmtime +<seconds> (or -<seconds>) file...
  *
  * Examples:
  *
  * To just print the mtime use --verbose and set the file mtime offset to 0:
  *
- *     test-chmtime -v +0 file
+ *     test-tool chmtime -v +0 file
  *
  * To set the mtime to current time:
  *
- *     test-chmtime =+0 file
+ *     test-tool chmtime =+0 file
  *
  */
+#include "test-tool.h"
 #include "git-compat-util.h"
 #include <utime.h>
 
@@ -56,7 +57,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)
        return 1;
 }
 
-int cmd_main(int argc, const char **argv)
+int cmd__chmtime(int argc, const char **argv)
 {
        static int verbose;
 
index da1dd6621c604018edd6510a5d649a7a221f5cb7..0b1abe1ea24b9cde1f94b3bf0696b109a4a4c24d 100644 (file)
@@ -7,6 +7,7 @@ struct test_cmd {
 };
 
 static struct test_cmd cmds[] = {
+       { "chmtime", cmd__chmtime },
 };
 
 int cmd_main(int argc, const char **argv)
index 6ce57ae0ccade5c575edf396078845a623e997c4..3a35e70e79e45448a393e3fb5d2fd44e97d935a2 100644 (file)
@@ -1,4 +1,6 @@
 #ifndef __TEST_TOOL_H__
 #define __TEST_TOOL_H__
 
+int cmd__chmtime(int argc, const char **argv);
+
 #endif
index 4c1f81f1678d83ab8b9ee7704d400bdd47ea70f7..a8130f9119d629462efb6b52f91890c0352e4e85 100644 (file)
@@ -49,7 +49,7 @@ rawsvnrepo="$svnrepo"
 svnrepo="file://$svnrepo"
 
 poke() {
-       test-chmtime +1 "$1"
+       test-tool chmtime +1 "$1"
 }
 
 # We need this, because we should pass empty configuration directory to
index a66936fe9bde2ba20ab0e57400b6286b0710212a..4b5d44328092e64d5268330906faf9fbaba023ba 100755 (executable)
@@ -332,12 +332,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '
        git update-index --add ten &&
        test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
        just_under_2_weeks_ago=$((5-14*86400)) &&
-       test-chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_under_2_weeks_ago .git/sharedindex.* &&
        : >eleven &&
        git update-index --add eleven &&
        test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
        just_over_2_weeks_ago=$((-1-14*86400)) &&
-       test-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
        : >twelve &&
        git update-index --add twelve &&
        test $(ls .git/sharedindex.* | wc -l) -le 2
@@ -345,12 +345,12 @@ test_expect_success 'shared index files expire after 2 weeks by default' '
 
 test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '
        git config splitIndex.sharedIndexExpire "16.days.ago" &&
-       test-chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_over_2_weeks_ago .git/sharedindex.* &&
        : >thirteen &&
        git update-index --add thirteen &&
        test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
        just_over_16_days_ago=$((-1-16*86400)) &&
-       test-chmtime =$just_over_16_days_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_over_16_days_ago .git/sharedindex.* &&
        : >fourteen &&
        git update-index --add fourteen &&
        test $(ls .git/sharedindex.* | wc -l) -le 2
@@ -359,13 +359,13 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to 16 days' '
 test_expect_success 'check splitIndex.sharedIndexExpire set to "never" and "now"' '
        git config splitIndex.sharedIndexExpire never &&
        just_10_years_ago=$((-365*10*86400)) &&
-       test-chmtime =$just_10_years_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_10_years_ago .git/sharedindex.* &&
        : >fifteen &&
        git update-index --add fifteen &&
        test $(ls .git/sharedindex.* | wc -l) -gt 2 &&
        git config splitIndex.sharedIndexExpire now &&
        just_1_second_ago=-1 &&
-       test-chmtime =$just_1_second_ago .git/sharedindex.* &&
+       test-tool chmtime =$just_1_second_ago .git/sharedindex.* &&
        : >sixteen &&
        git update-index --add sixteen &&
        test $(ls .git/sharedindex.* | wc -l) -le 2
index f46d0499bc6ea95236f7ca05060b8f8fbbdbbc50..e74d58b9e198a4ea2195d3fc6906e651a0a1d650 100755 (executable)
@@ -68,13 +68,13 @@ test_expect_success 'do not touch files that are already up-to-date' '
        git add file1 file2 &&
        git commit -m base &&
        echo modified >file1 &&
-       test-chmtime =1000000000 file2 &&
+       test-tool chmtime =1000000000 file2 &&
        git update-index -q --refresh &&
        git checkout HEAD -- file1 file2 &&
        echo one >expect &&
        test_cmp expect file1 &&
        echo "1000000000        file2" >expect &&
-       test-chmtime -v +0 file2 >actual &&
+       test-tool chmtime -v +0 file2 >actual &&
        test_cmp expect actual
 '
 
index 86bf909ee3dfca78f678fdefe961772dcd78d6b1..61748088ebcbed700a570bc0e297f48435844340 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success 'setup: create a few commits with notes' '
        git commit -m 3rd &&
        COMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
        test -f $COMMIT_FILE &&
-       test-chmtime =+0 $COMMIT_FILE &&
+       test-tool chmtime =+0 $COMMIT_FILE &&
        git notes add -m "Note #3"
 '
 
index 3b905406df79187f70c828f72e9e2dc187f1be57..961ac9d6b85b5826df0e6adc00404fd1c605c933 100755 (executable)
@@ -711,13 +711,13 @@ test_expect_success 'rebase -i continue with unstaged submodule' '
 test_expect_success 'avoid unnecessary reset' '
        git checkout master &&
        git reset --hard &&
-       test-chmtime =123456789 file3 &&
+       test-tool chmtime =123456789 file3 &&
        git update-index --refresh &&
        HEAD=$(git rev-parse HEAD) &&
        set_fake_editor &&
        git rebase -i HEAD~4 &&
        test $HEAD = $(git rev-parse HEAD) &&
-       MTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&
+       MTIME=$(test-tool chmtime -v +0 file3 | sed 's/[^0-9].*$//') &&
        test 123456789 = $MTIME
 '
 
index 7c91a85f43a7a11295819adc5da5f8e5fca9e4ea..9214d0bb511e24f401188790858dc1e0ca1b92fd 100755 (executable)
@@ -24,7 +24,7 @@ test_expect_success 'interactive rebase --continue works with touched file' '
        git checkout master &&
 
        FAKE_LINES="edit 1" git rebase -i HEAD^ &&
-       test-chmtime =-60 F1 &&
+       test-tool chmtime =-60 F1 &&
        git rebase --continue
 '
 
@@ -36,7 +36,7 @@ test_expect_success 'non-interactive rebase --continue works with touched file'
        test_must_fail git rebase --onto master master topic &&
        echo "Resolved" >F2 &&
        git add F2 &&
-       test-chmtime =-60 F1 &&
+       test-tool chmtime =-60 F1 &&
        git rebase --continue
 '
 
index 783bdbf59db07ebf2afac83165d31b86fd6b95db..ccbc11851497a10c74dcdaba1ed7238aa6b409f7 100755 (executable)
@@ -86,7 +86,7 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
        (
                cd copy &&
                git checkout initial &&
-               test-chmtime +40 oops &&
+               test-tool chmtime +40 oops &&
                git cherry-pick added
        )
 '
index 0acf4b14614c750d3c2324d8a941aa77d5c7ad56..9f93445f1e496b930f4f7cb53146344315bc1c8e 100755 (executable)
@@ -247,9 +247,9 @@ test_expect_success '--abort after last commit in sequence' '
 test_expect_success 'cherry-pick does not implicitly stomp an existing operation' '
        pristine_detach initial &&
        test_expect_code 1 git cherry-pick base..anotherpick &&
-       test-chmtime -v +0 .git/sequencer >expect &&
+       test-tool chmtime -v +0 .git/sequencer >expect &&
        test_expect_code 128 git cherry-pick unrelatedpick &&
-       test-chmtime -v +0 .git/sequencer >actual &&
+       test-tool chmtime -v +0 .git/sequencer >actual &&
        test_cmp expect actual
 '
 
index 46f15169f55c03742717f36f8d0e99241391b2ea..b8fbdefcdc34ffa6fb54fc1ad375a583a194fb38 100755 (executable)
@@ -232,7 +232,7 @@ test_expect_success 'Call "rm" from outside the work tree' '
 test_expect_success 'refresh index before checking if it is up-to-date' '
 
        git reset --hard &&
-       test-chmtime -86400 frotz/nitfol &&
+       test-tool chmtime -86400 frotz/nitfol &&
        git rm frotz/nitfol &&
        test ! -f frotz/nitfol
 
index 2748805642201d7c514792bab8d8b3940fb4086c..07af05d7aee65c51245431292a21ec38eef19f53 100755 (executable)
@@ -187,7 +187,7 @@ test_expect_success 'git add --refresh with pathspec' '
        echo >foo && echo >bar && echo >baz &&
        git add foo bar baz && H=$(git rev-parse :foo) && git rm -f foo &&
        echo "100644 $H 3       foo" | git update-index --index-info &&
-       test-chmtime -60 bar baz &&
+       test-tool chmtime -60 bar baz &&
        >expect &&
        git add --refresh bar >actual &&
        test_cmp expect actual &&
index 13e7f621ab79f95cc7c3057d9de5710813049102..cf0f3a1ee75dd28c6b5ce2a5db7c3ad6afafd21f 100755 (executable)
@@ -73,7 +73,7 @@ test_expect_success 'diff identical, but newly created symlink and file' '
        >expected &&
        rm -f frotz nitfol &&
        echo xyzzy >nitfol &&
-       test-chmtime +10 nitfol &&
+       test-tool chmtime +10 nitfol &&
        if test_have_prereq SYMLINKS
        then
                ln -s xyzzy frotz
index 3f9a24fd56c801d1a75abb6cc4f4e8928c2dc427..f8d853595b99bfff64521a502ee062b7e5f35e5f 100755 (executable)
@@ -76,7 +76,7 @@ test_expect_success setup '
 
        mkdir dir3 &&
        cp dir/sub dir3/sub &&
-       test-chmtime +1 dir3/sub &&
+       test-tool chmtime +1 dir3/sub &&
 
        git config log.showroot false &&
        git commit --amend &&
index 2f1737fcef185486dc626d616c37fdadc11deba1..0352bf81a90a38adf14fb7a980c98600e1f650b2 100755 (executable)
@@ -147,7 +147,7 @@ test_expect_success 'git diff --ignore-all-space, both files outside repo' '
 '
 
 test_expect_success 'git diff --quiet ignores stat-change only entries' '
-       test-chmtime +10 a &&
+       test-tool chmtime +10 a &&
        echo modified >>b &&
        test_expect_code 1 git diff --quiet
 '
index 16432781d2e0d52c33dfb1444fcce4459b417e8b..9d8d3c72e7efe68b8e0011c1ec9b77d9a0820b30 100755 (executable)
@@ -171,7 +171,7 @@ test_expect_success 'am --skip leaves index stat info alone' '
        git checkout -f --orphan skip-stat-info &&
        git reset &&
        test_commit skip-should-be-untouched &&
-       test-chmtime =0 skip-should-be-untouched.t &&
+       test-tool chmtime =0 skip-should-be-untouched.t &&
        git update-index --refresh &&
        git diff-files --exit-code --quiet &&
        test_must_fail git am 0001-*.patch &&
@@ -183,7 +183,7 @@ test_expect_success 'am --abort leaves index stat info alone' '
        git checkout -f --orphan abort-stat-info &&
        git reset &&
        test_commit abort-should-be-untouched &&
-       test-chmtime =0 abort-should-be-untouched.t &&
+       test-tool chmtime =0 abort-should-be-untouched.t &&
        git update-index --refresh &&
        git diff-files --exit-code --quiet &&
        test_must_fail git am 0001-*.patch &&
index d97d2bebc9850c8ba96a8263ed081fced2ecc153..deafaa3e07546cea3d0bcf3aa3c00e2ba7e41406 100755 (executable)
@@ -166,7 +166,7 @@ test_expect_success 'first postimage wins' '
        git commit -q -a -m "prefer first over second" &&
        test -f $rr/postimage &&
 
-       oldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) &&
+       oldmtimepost=$(test-tool chmtime -v -60 $rr/postimage | cut -f 1) &&
 
        git checkout -b third master &&
        git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
@@ -179,7 +179,7 @@ test_expect_success 'first postimage wins' '
 '
 
 test_expect_success 'rerere updates postimage timestamp' '
-       newmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) &&
+       newmtimepost=$(test-tool chmtime -v +0 $rr/postimage | cut -f 1) &&
        test $oldmtimepost -lt $newmtimepost
 '
 
@@ -220,9 +220,9 @@ test_expect_success 'set up for garbage collection tests' '
        almost_60_days_ago=$((60-60*86400)) &&
        just_over_60_days_ago=$((-1-60*86400)) &&
 
-       test-chmtime =$just_over_60_days_ago $rr/preimage &&
-       test-chmtime =$almost_60_days_ago $rr/postimage &&
-       test-chmtime =$almost_15_days_ago $rr2/preimage
+       test-tool chmtime =$just_over_60_days_ago $rr/preimage &&
+       test-tool chmtime =$almost_60_days_ago $rr/postimage &&
+       test-tool chmtime =$almost_15_days_ago $rr2/preimage
 '
 
 test_expect_success 'gc preserves young or recently used records' '
@@ -232,8 +232,8 @@ test_expect_success 'gc preserves young or recently used records' '
 '
 
 test_expect_success 'old records rest in peace' '
-       test-chmtime =$just_over_60_days_ago $rr/postimage &&
-       test-chmtime =$just_over_15_days_ago $rr2/preimage &&
+       test-tool chmtime =$just_over_60_days_ago $rr/postimage &&
+       test-tool chmtime =$just_over_15_days_ago $rr2/preimage &&
        git rerere gc &&
        ! test -f $rr/preimage &&
        ! test -f $rr2/preimage
@@ -249,8 +249,8 @@ rerere_gc_custom_expiry_test () {
                >"$rr/postimage" &&
 
                two_days_ago=$((-2*86400)) &&
-               test-chmtime =$two_days_ago "$rr/preimage" &&
-               test-chmtime =$two_days_ago "$rr/postimage" &&
+               test-tool chmtime =$two_days_ago "$rr/preimage" &&
+               test-tool chmtime =$two_days_ago "$rr/postimage" &&
 
                find .git/rr-cache -type f | sort >original &&
 
@@ -512,7 +512,7 @@ test_expect_success 'multiple identical conflicts' '
        count_pre_post 2 0 &&
 
        # Pretend that the conflicts were made quite some time ago
-       find .git/rr-cache/ -type f | xargs test-chmtime -172800 &&
+       find .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&
 
        # Unresolved entries have not expired yet
        git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
@@ -568,7 +568,7 @@ test_expect_success 'multiple identical conflicts' '
        git rerere &&
 
        # Pretend that the resolutions are old again
-       find .git/rr-cache/ -type f | xargs test-chmtime -172800 &&
+       find .git/rr-cache/ -type f | xargs test-tool chmtime -172800 &&
 
        # Resolved entries have not expired yet
        git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
index fe2d4f15a73f082c516a03b1877c4cf82982138a..266d052efb3f8a86d917e74eafc05c8d7dfee748 100755 (executable)
@@ -192,7 +192,7 @@ test_expect_success \
     'validate file modification time' \
     'mkdir extract &&
      "$TAR" xf b.tar -C extract a/a &&
-     test-chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
+     test-tool chmtime -v +0 extract/a/a |cut -f 1 >b.mtime &&
      echo "1117231200" >expected.mtime &&
      test_cmp expected.mtime b.mtime'
 
index 6694c19a1eecf10117b843bbacbc5bb47924c9c8..f0f6e2a5f3d015cb8d753c3d965c1c42e27b5784 100755 (executable)
@@ -15,7 +15,7 @@ add_blob() {
        BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
        verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
-       test-chmtime =+0 $BLOB_FILE
+       test-tool chmtime =+0 $BLOB_FILE
 }
 
 test_expect_success setup '
@@ -33,7 +33,7 @@ test_expect_success 'prune stale packs' '
        orig_pack=$(echo .git/objects/pack/*.pack) &&
        : > .git/objects/tmp_1.pack &&
        : > .git/objects/tmp_2.pack &&
-       test-chmtime =-86501 .git/objects/tmp_1.pack &&
+       test-tool chmtime =-86501 .git/objects/tmp_1.pack &&
        git prune --expire 1.day &&
        test_path_is_file $orig_pack &&
        test_path_is_file .git/objects/tmp_2.pack &&
@@ -47,7 +47,7 @@ test_expect_success 'prune --expire' '
        git prune --expire=1.hour.ago &&
        verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
-       test-chmtime =-86500 $BLOB_FILE &&
+       test-tool chmtime =-86500 $BLOB_FILE &&
        git prune --expire 1.day &&
        verbose test $before = $(git count-objects | sed "s/ .*//") &&
        test_path_is_missing $BLOB_FILE
@@ -57,11 +57,11 @@ test_expect_success 'prune --expire' '
 test_expect_success 'gc: implicit prune --expire' '
 
        add_blob &&
-       test-chmtime =-$((2*$week-30)) $BLOB_FILE &&
+       test-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&
        git gc &&
        verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
        test_path_is_file $BLOB_FILE &&
-       test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
+       test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
        git gc &&
        verbose test $before = $(git count-objects | sed "s/ .*//") &&
        test_path_is_missing $BLOB_FILE
@@ -141,7 +141,7 @@ test_expect_success 'prune: do not prune heads listed as an argument' '
 test_expect_success 'gc --no-prune' '
 
        add_blob &&
-       test-chmtime =-$((5001*$day)) $BLOB_FILE &&
+       test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
        git config gc.pruneExpire 2.days.ago &&
        git gc --no-prune &&
        verbose test 1 = $(git count-objects | sed "s/ .*//") &&
@@ -163,7 +163,7 @@ test_expect_success 'gc respects gc.pruneExpire' '
 test_expect_success 'gc --prune=<date>' '
 
        add_blob &&
-       test-chmtime =-$((5001*$day)) $BLOB_FILE &&
+       test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
        git gc --prune=5002.days.ago &&
        test_path_is_file $BLOB_FILE &&
        git gc --prune=5000.days.ago &&
@@ -205,7 +205,7 @@ test_expect_success 'prune --expire=never' '
 
 test_expect_success 'gc: prune old objects after local clone' '
        add_blob &&
-       test-chmtime =-$((2*$week+1)) $BLOB_FILE &&
+       test-tool chmtime =-$((2*$week+1)) $BLOB_FILE &&
        git clone --no-hardlinks . aclone &&
        (
                cd aclone &&
index d375d7110d102d6b3ea194e4f09a9b5f391ed496..911eae1bf7518485ace0fbd417e3ea0bbb18a9cf 100755 (executable)
@@ -180,7 +180,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
            # And create a file that follows the temporary object naming
            # convention for the auto-gc to remove
            : >.git/objects/tmp_test_object &&
-           test-chmtime =-1209601 .git/objects/tmp_test_object
+           test-tool chmtime =-1209601 .git/objects/tmp_test_object
        ) &&
        (
            cd parent &&
index 177897ea0b1e00cc4ec0f0e43510411ab19f1681..82239138d585bb859a1f2f81394cb6b6d8313bf4 100755 (executable)
@@ -1418,7 +1418,7 @@ test_expect_success 'receive.denyCurrentBranch = updateInstead' '
                cd testrepo &&
                git reset --hard HEAD^ &&
                test $(git -C .. rev-parse HEAD^) = $(git rev-parse HEAD) &&
-               test-chmtime +100 path1
+               test-tool chmtime +100 path1
        ) &&
        git push testrepo master &&
        (
index c01f721f13dba71fae681d6ba5100e02e58de4d8..a1fad6980b936152d599fee8cac82610404a0673 100755 (executable)
@@ -635,10 +635,10 @@ test_expect_success 'setup avoid unnecessary update, normal rename' '
 
 test_expect_success 'avoid unnecessary update, normal rename' '
        git checkout -q avoid-unnecessary-update-1^0 &&
-       test-chmtime =1000000000 rename &&
-       test-chmtime -v +0 rename >expect &&
+       test-tool chmtime =1000000000 rename &&
+       test-tool chmtime -v +0 rename >expect &&
        git merge merge-branch-1 &&
-       test-chmtime -v +0 rename >actual &&
+       test-tool chmtime -v +0 rename >actual &&
        test_cmp expect actual # "rename" should have stayed intact
 '
 
@@ -668,10 +668,10 @@ test_expect_success 'setup to test avoiding unnecessary update, with D/F conflic
 
 test_expect_success 'avoid unnecessary update, with D/F conflict' '
        git checkout -q avoid-unnecessary-update-2^0 &&
-       test-chmtime =1000000000 df &&
-       test-chmtime -v +0 df >expect &&
+       test-tool chmtime =1000000000 df &&
+       test-tool chmtime -v +0 df >expect &&
        git merge merge-branch-2 &&
-       test-chmtime -v +0 df >actual &&
+       test-tool chmtime -v +0 df >actual &&
        test_cmp expect actual # "df" should have stayed intact
 '
 
@@ -700,10 +700,10 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
 
 test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
        git checkout -q master^0 &&
-       test-chmtime =1000000000 df &&
-       test-chmtime -v +0 df >expect &&
+       test-tool chmtime =1000000000 df &&
+       test-tool chmtime -v +0 df >expect &&
        git merge side &&
-       test-chmtime -v +0 df >actual &&
+       test-tool chmtime -v +0 df >actual &&
        test_cmp expect actual # "df" should have stayed intact
 '
 
@@ -730,10 +730,10 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
 
 test_expect_success 'avoid unnecessary update, modify/delete' '
        git checkout -q master^0 &&
-       test-chmtime =1000000000 file &&
-       test-chmtime -v +0 file >expect &&
+       test-tool chmtime =1000000000 file &&
+       test-tool chmtime -v +0 file >expect &&
        test_must_fail git merge side &&
-       test-chmtime -v +0 file >actual &&
+       test-tool chmtime -v +0 file >actual &&
        test_cmp expect actual # "file" should have stayed intact
 '
 
@@ -759,10 +759,10 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
 
 test_expect_success 'avoid unnecessary update, rename/add-dest' '
        git checkout -q master^0 &&
-       test-chmtime =1000000000 newfile &&
-       test-chmtime -v +0 newfile >expect &&
+       test-tool chmtime =1000000000 newfile &&
+       test-tool chmtime -v +0 newfile >expect &&
        git merge side &&
-       test-chmtime -v +0 newfile >actual &&
+       test-tool chmtime -v +0 newfile >actual &&
        test_cmp expect actual # "file" should have stayed intact
 '
 
index 41b0be575d523071152c19a224a7ef914ce2ee1a..d5255dd5760389fbbabf1c2ffc787500e4184758 100755 (executable)
@@ -87,7 +87,7 @@ test_expect_success 'background auto gc does not run if gc.log is present and re
        test_must_fail git gc --auto 2>err &&
        test_i18ngrep "^error:" err &&
        test_config gc.logexpiry 5.days &&
-       test-chmtime =-345600 .git/gc.log &&
+       test-tool chmtime =-345600 .git/gc.log &&
        test_must_fail git gc --auto &&
        test_config gc.logexpiry 2.days &&
        run_and_wait_for_auto_gc &&
index 394b169eada7968875e931c5a43f25a808cfc18f..765cced60b1055e1187e1fdc1c1c881814cebbf6 100755 (executable)
@@ -73,7 +73,7 @@ for repack in '' true; do
 
        test_expect_success "simulate time passing ($title)" '
                find .git/objects -type f |
-               xargs test-chmtime -v -86400
+               xargs test-tool chmtime -v -86400
        '
 
        test_expect_success "start writing new commit with old blob ($title)" '
@@ -104,7 +104,7 @@ for repack in '' true; do
        test_expect_success "abandon objects again ($title)" '
                git reset --hard HEAD^ &&
                find .git/objects -type f |
-               xargs test-chmtime -v -86400
+               xargs test-tool chmtime -v -86400
        '
 
        test_expect_success "start writing new commit with same tree ($title)" '
index 50052e28727dab74037a115003b6083256d7f344..7afadb175a64c629214b7d6961ac345edb14ed84 100755 (executable)
@@ -1672,12 +1672,12 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
 '
 
 test_expect_success '--no-optional-locks prevents index update' '
-       test-chmtime =1234567890 .git/index &&
+       test-tool chmtime =1234567890 .git/index &&
        git --no-optional-locks status &&
-       test-chmtime -v +0 .git/index >out &&
+       test-tool chmtime -v +0 .git/index >out &&
        grep ^1234567890 out &&
        git status &&
-       test-chmtime -v +0 .git/index >out &&
+       test-tool chmtime -v +0 .git/index >out &&
        ! grep ^1234567890 out
 '
 
index 987573c41fcd4aee3d5f8fd8aa587c97551c1872..8a586ab0210bf6a7fcff7729d46bb882d50fe330 100755 (executable)
@@ -90,7 +90,7 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '
        tmppack=".git/objects/pack/tmp_pack" &&
        ln "$packfile" "$tmppack" &&
        git repack -A -l -d &&
-       test-chmtime -v +0 "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" \
+       test-tool chmtime -v +0 "$tmppack" "$fsha1path" "$csha1path" "$tsha1path" \
                > mtimes &&
        compare_mtimes < mtimes
 '
@@ -103,7 +103,7 @@ test_expect_success 'do not bother loosening old objects' '
        git prune-packed &&
        git cat-file -p $obj1 &&
        git cat-file -p $obj2 &&
-       test-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
+       test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
        git repack -A -d --unpack-unreachable=1.hour.ago &&
        git cat-file -p $obj1 &&
        test_must_fail git cat-file -p $obj2
@@ -117,7 +117,7 @@ test_expect_success 'keep packed objects found only in index' '
        git reset HEAD^ &&
        git reflog expire --expire=now --all &&
        git add file &&
-       test-chmtime =-86400 .git/objects/pack/* &&
+       test-tool chmtime =-86400 .git/objects/pack/* &&
        git gc --prune=1.hour.ago &&
        git cat-file blob :file
 '
index 8a8ba65a2ae583aa5d0b0526e604a8f9613b5a5e..c937330a5f3a7f6b5c4d8e406564bd88dd0c889b 100755 (executable)
@@ -288,12 +288,12 @@ test_expect_success 'able to dcommit to a subdirectory' '
 
 test_expect_success 'dcommit should not fail with a touched file' '
        test_commit "commit-new-file-foo2" foo2 &&
-       test-chmtime =-60 foo &&
+       test-tool chmtime =-60 foo &&
        git svn dcommit
 '
 
 test_expect_success 'rebase should not fail with a touched file' '
-       test-chmtime =-60 foo &&
+       test-tool chmtime =-60 foo &&
        git svn rebase
 '
 
index d950c7d665498c484f83d127cd2363def5169a89..d5c367510049607ce33db73ffc1869a0652fe663 100755 (executable)
@@ -28,7 +28,7 @@ test_expect_success 'shell metachars in filenames' '
                echo f2 >"file with spaces" &&
                git add "file with spaces" &&
                git commit -m "add files" &&
-               P4EDITOR="test-chmtime +5" git p4 submit
+               P4EDITOR="test-tool chmtime +5" git p4 submit
        ) &&
        (
                cd "$cli" &&
@@ -47,7 +47,7 @@ test_expect_success 'deleting with shell metachars' '
                git rm foo\$bar &&
                git rm file\ with\ spaces &&
                git commit -m "remove files" &&
-               P4EDITOR="test-chmtime +5" git p4 submit
+               P4EDITOR="test-tool chmtime +5" git p4 submit
        ) &&
        (
                cd "$cli" &&
index bda222aa0270f3a93fa494b308aa174ebc942eca..783c6ad1653142d174e4ddc6d49e1f631121be51 100755 (executable)
@@ -53,7 +53,7 @@ test_expect_success 'preserve users' '
                git commit --author "Alice <alice@example.com>" -m "a change by alice" file1 &&
                git commit --author "Bob <bob@example.com>" -m "a change by bob" file2 &&
                git config git-p4.skipSubmitEditCheck true &&
-               P4EDITOR="test-chmtime +5" P4USER=alice P4PASSWD=secret &&
+               P4EDITOR="test-tool chmtime +5" P4USER=alice P4PASSWD=secret &&
                export P4EDITOR P4USER P4PASSWD &&
                git p4 commit --preserve-user &&
                p4_check_commit_author file1 alice &&
@@ -71,7 +71,7 @@ test_expect_success 'refuse to preserve users without perms' '
                git config git-p4.skipSubmitEditCheck true &&
                echo "username-noperms: a change by alice" >>file1 &&
                git commit --author "Alice <alice@example.com>" -m "perms: a change by alice" file1 &&
-               P4EDITOR="test-chmtime +5" P4USER=bob P4PASSWD=secret &&
+               P4EDITOR="test-tool chmtime +5" P4USER=bob P4PASSWD=secret &&
                export P4EDITOR P4USER P4PASSWD &&
                test_must_fail git p4 commit --preserve-user &&
                ! git diff --exit-code HEAD..p4/master
@@ -89,7 +89,7 @@ test_expect_success 'preserve user where author is unknown to p4' '
                git commit --author "Bob <bob@example.com>" -m "preserve: a change by bob" file1 &&
                echo "username-unknown: a change by charlie" >>file1 &&
                git commit --author "Charlie <charlie@example.com>" -m "preserve: a change by charlie" file1 &&
-               P4EDITOR="test-chmtime +5" P4USER=alice P4PASSWD=secret &&
+               P4EDITOR="test-tool chmtime +5" P4USER=alice P4PASSWD=secret &&
                export P4EDITOR P4USER P4PASSWD &&
                test_must_fail git p4 commit --preserve-user &&
                ! git diff --exit-code HEAD..p4/master &&
index 6dc6df032ec0c15b39dccd24ade52580fc115add..3c22f74bd436b7c6d94d5c29d5b2e3e3510d58e6 100755 (executable)
@@ -26,7 +26,7 @@ test_expect_success 'EDITOR with options' '
                cd "$git" &&
                echo change >file1 &&
                git commit -m "change" file1 &&
-               P4EDITOR=": >\"$git/touched\" && test-chmtime +5" git p4 submit &&
+               P4EDITOR=": >\"$git/touched\" && test-tool chmtime +5" git p4 submit &&
                test_path_is_file "$git/touched"
        )
 '
index 7740d511d289f44bb1313308fe49d5894f64b3c2..7ab8af47a56f8cd5b1083292c0f00522f66c04f6 100644 (file)
@@ -963,10 +963,10 @@ test -d "$GIT_BUILD_DIR"/templates/blt || {
        error "You haven't built things yet, have you?"
 }
 
-if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime
+if ! test -x "$GIT_BUILD_DIR"/t/helper/test-tool
 then
-       echo >&2 'You need to build test-chmtime:'
-       echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory'
+       echo >&2 'You need to build test-tool:'
+       echo >&2 'Run "make t/helper/test-tool" in the source (toplevel) directory'
        exit 1
 fi