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>

Luke Diamand committed Apr 26, 2016 at 08:50 UTC d1deaf4d02065fd8a1ace538df22a2125cf0b994
1 file changed +1 -1
t/lib-git-p4.sh
+1 -1
@@ -50,7 +50,7 @@ native_path() {
50 # at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)'
51 # function could fix that but it is not in Python until 3.3.
52 time_in_seconds() {
53 - python -c 'import time; print int(time.time())'
53 + (cd / && python -c 'import time; print(int(time.time()))')
54 }
55
56 # Try to pick a unique port: guess a large number, then hope