From a87eac3e545d401631164df2218e34e19f42ffee Mon Sep 17 00:00:00 2001 From: Luke Diamand Date: Fri, 29 Apr 2016 08:40:26 +0100 Subject: git-p4: workaround p4 removal of client directory 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 Tested-by: Jacob Smith Signed-off-by: Junio C Hamano --- git-p4.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() -- cgit v1.2.1