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>
Johannes Schindelin committed
Nov 8, 2020 at 08:41 UTC
1b09d1917f376d52e191102509d08303f8d26388
1 file changed
+1
-1
git-p4.py
+1
-1
@@ -4186,7 +4186,7 @@ class P4Clone(P4Sync):
4186
4187
# create a master branch and check out a work tree
4188
if gitBranchExists(self.branch):
4189
- system([ "git", "branch", "master", self.branch ])
4189
+ system([ "git", "branch", currentGitBranch(), self.branch ])
4190
if not self.cloneBare:
4191
system([ "git", "checkout", "-f" ])
4192
else: