1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 03:06:17 +02:00

p4: respect init.defaultBranch

In `git p4 clone`, we hard-code the branch name `master` instead of
looking what the _actual_ initial branch name is. Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin 2020-11-08 08:41:51 +00:00 committed by Junio C Hamano
parent 898f80736c
commit 1b09d1917f

View File

@ -4186,7 +4186,7 @@ def run(self, args):
# create a master branch and check out a work tree
if gitBranchExists(self.branch):
system([ "git", "branch", "master", self.branch ])
system([ "git", "branch", currentGitBranch(), self.branch ])
if not self.cloneBare:
system([ "git", "checkout", "-f" ])
else: