summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLuke Diamand <luke@diamand.org>2016-04-26 08:50:59 +0100
committerJunio C Hamano <gitster@pobox.com>2016-04-26 10:47:02 -0700
commitd1deaf4d02065fd8a1ace538df22a2125cf0b994 (patch)
tree77b9a79f20b7d5e76bea1523340e0a30949a7ab6 /t
parent6a6636270fbaf74609cd3e1bd207dd2c420d640a (diff)
downloadgit-d1deaf4d02065fd8a1ace538df22a2125cf0b994.tar.gz
git-p4 tests: cd to / before running python
The python one-liner for getting the current time prints out error messages if the current directory is deleted while it is running if using python3. Avoid these messages by switching to "/" before running it. This problem does not arise if using python2. Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/lib-git-p4.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index f9ae1d780d..724bc43e4b 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -50,7 +50,7 @@ native_path() {
# at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)'
# function could fix that but it is not in Python until 3.3.
time_in_seconds() {
- python -c 'import time; print int(time.time())'
+ (cd / && python -c 'import time; print(int(time.time()))')
}
# Try to pick a unique port: guess a large number, then hope