[PATCH 17/17] git p4 clone --bare: need to be explicit about the gitdir
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 2, 2026, 14:33 UTC
- Message-ID
- <c8e5bef27b4635774eb88f29c98e35e2c613d5a8.1775140403.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.2076.git.1775140403.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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 <johannes.schindelin@gmx.de> --- 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)
-- gitgitgadget