Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-04-14 21:38:13 +0400
committerJunio C Hamano <gitster@pobox.com>2011-04-14 21:47:18 +0400
commite3b02bc9533007f9e7aa9d7738a0f92c952dcff6 (patch)
treebaf748939e503e428a7cfc7ea7cd12c4d3e7046e /t/t5304-prune.sh
parentfd5858b49bd0672d96026a9cff690c2b8730cb0c (diff)
t3306,t5304: avoid clock skew issues
On systems where the local time and file modification time may be out of sync (e.g. test directory on NFS) t3306 and t5305 can fail because prune compares times such as "now" (client time) with file modification times (server times for remote file systems). I.e., these are spurious test failures. Avoid this by setting the relevant modification times to the local time. Noticed on a system with as little as 2s time skew. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5304-prune.sh')
-rwxr-xr-xt/t5304-prune.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index e2ed13dba2..d645328609 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -14,7 +14,8 @@ add_blob() {
BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
- test -f $BLOB_FILE
+ test -f $BLOB_FILE &&
+ test-chmtime =+0 $BLOB_FILE
}
test_expect_success setup '