]> git.ipfire.org Git - thirdparty/git.git/commitdiff
p4: respect init.defaultBranch
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 8 Nov 2020 08:41:51 +0000 (08:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Nov 2020 21:01:47 +0000 (13:01 -0800)
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>
git-p4.py

index 4433ca53de7eff82c29a191019f1b6477f53f3bb..52ddb1d7b2d6e40abfb7221d0329f3412b1b7b68 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -4186,7 +4186,7 @@ class P4Clone(P4Sync):
 
         # 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: