* [PATCH] p4: respect init.defaultBranch
@ 2020-11-08 8:41 Johannes Schindelin via GitGitGadget
2020-11-09 21:02 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-08 8:41 UTC (permalink / raw)
To: git; +Cc: Luke Diamand, Johannes Schindelin, Johannes Schindelin
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
---
p4: respect init.defaultBranch
Just something I noticed while working on the big master -> main rename
in the test suite.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-782%2Fdscho%2Fgit-p4-and-init.defaultBranch-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/782
git-p4.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index 4433ca53de..52ddb1d7b2 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -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:
base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d
--
gitgitgadget
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] p4: respect init.defaultBranch
2020-11-08 8:41 [PATCH] p4: respect init.defaultBranch Johannes Schindelin via GitGitGadget
@ 2020-11-09 21:02 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2020-11-09 21:02 UTC (permalink / raw)
To: Johannes Schindelin via GitGitGadget
Cc: git, Luke Diamand, Johannes Schindelin
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> 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>
> ---
Makes sense. Will queue. Thanks.
> p4: respect init.defaultBranch
>
> Just something I noticed while working on the big master -> main rename
> in the test suite.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-782%2Fdscho%2Fgit-p4-and-init.defaultBranch-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/782
>
> git-p4.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index 4433ca53de..52ddb1d7b2 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -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:
>
> base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-09 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 8:41 [PATCH] p4: respect init.defaultBranch Johannes Schindelin via GitGitGadget
2020-11-09 21:02 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).