From 347da97f3e6efe4cb85ffa39b42da9ff96cb8e28 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 2 Apr 2026 14:33:23 +0000 Subject: [PATCH] git p4 clone --bare: need to be explicit about the gitdir When `safe.bareRepository` will change to be safe by default, bare repositories won't be discovered by default anymore. To prepare for this, `git p4` must be explicit about the gitdir when cloning into a bare repository, and no longer rely on that implicit discovery. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-p4.py | 1 + 1 file changed, 1 insertion(+) diff --git a/git-p4.py b/git-p4.py index c0ca7becaf..dd38dbca22 100755 --- a/git-p4.py +++ b/git-p4.py @@ -4360,6 +4360,7 @@ class P4Clone(P4Sync): init_cmd = ["git", "init"] if self.cloneBare: init_cmd.append("--bare") + os.environ["GIT_DIR"] = os.getcwd() retcode = subprocess.call(init_cmd) if retcode: raise subprocess.CalledProcessError(retcode, init_cmd)