{"thread":{"id":"54599","subject":"[PATCH] p4: respect init.defaultBranch","startedAt":"2020-11-08T08:42:06Z","lastAt":"2020-11-09T21:02:12Z","messageCount":2,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"409331","messageId":"pull.782.git.1604824911359.gitgitgadget@gmail.com","threadId":"54599","inReplyTo":null,"subject":"[PATCH] p4: respect init.defaultBranch","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-11-08T08:41:51Z","receivedAt":"2020-11-08T08:42:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn `git p4 clone`, we hard-code the branch name `master` instead of\nlooking what the _actual_ initial branch name is. Let's fix that.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    p4: respect init.defaultBranch\n    \n    Just something I noticed while working on the big master -> main rename\n    in the test suite.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-782%2Fdscho%2Fgit-p4-and-init.defaultBranch-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/782\n\n git-p4.py | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 4433ca53de..52ddb1d7b2 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -4186,7 +4186,7 @@ def run(self, args):\n \n         # create a master branch and check out a work tree\n         if gitBranchExists(self.branch):\n-            system([ \"git\", \"branch\", \"master\", self.branch ])\n+            system([ \"git\", \"branch\", currentGitBranch(), self.branch ])\n             if not self.cloneBare:\n                 system([ \"git\", \"checkout\", \"-f\" ])\n         else:\n\nbase-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d\n-- \ngitgitgadget\n"},{"id":"409413","messageId":"xmqqd00mb5wy.fsf@gitster.c.googlers.com","threadId":"54599","inReplyTo":"pull.782.git.1604824911359.gitgitgadget@gmail.com","subject":"Re: [PATCH] p4: respect init.defaultBranch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-09T21:02:05Z","receivedAt":"2020-11-09T21:02:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> In `git p4 clone`, we hard-code the branch name `master` instead of\n> looking what the _actual_ initial branch name is. Let's fix that.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n\nMakes sense.  Will queue.  Thanks.\n\n>     p4: respect init.defaultBranch\n>     \n>     Just something I noticed while working on the big master -> main rename\n>     in the test suite.\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-782%2Fdscho%2Fgit-p4-and-init.defaultBranch-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/782\n>\n>  git-p4.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-p4.py b/git-p4.py\n> index 4433ca53de..52ddb1d7b2 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -4186,7 +4186,7 @@ def run(self, args):\n>  \n>          # create a master branch and check out a work tree\n>          if gitBranchExists(self.branch):\n> -            system([ \"git\", \"branch\", \"master\", self.branch ])\n> +            system([ \"git\", \"branch\", currentGitBranch(), self.branch ])\n>              if not self.cloneBare:\n>                  system([ \"git\", \"checkout\", \"-f\" ])\n>          else:\n>\n> base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d\n"}]}