summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Diamand <luke@diamand.org>2016-04-29 08:40:26 +0100
committerJunio C Hamano <gitster@pobox.com>2016-04-29 15:29:27 -0700
commita87eac3e545d401631164df2218e34e19f42ffee (patch)
tree3dfc59f7d25ac0b255a63c5bc012d99b116fa5ce
parent90f7b16b3adc78d4bbabbd426fb69aa78c714f71 (diff)
downloadgit-ld/p4-sync-workaround.tar.gz
git-p4: workaround p4 removal of client directoryld/p4-sync-workaround
On some platforms, "p4 sync -f" will remove the workspace directory after we have just created it; on some it won't. This causes problems later when git finds itself in an orphaned directory. Workaround this by cd'ing back to the directory after the "p4 sync -f". Signed-off-by: Luke Diamand <luke@diamand.org> Tested-by: Jacob Smith <jaroslav@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-p4.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 825b9f32d5..84ff679ccb 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
#
# git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
#
@@ -1947,6 +1947,9 @@ class P4Submit(Command, P4UserMap):
if new_client_dir:
# old one was destroyed, and maybe nobody told p4
p4_sync("...", "-f")
+
+ # sometimes p4 will unlink the directory and recreate it
+ chdir(self.clientPath, is_client_path=True)
else:
p4_sync("...")
self.check()