git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-p4: Fix checkout bug when using --import-local.

From
Simon Hausmann <simon@lst.de>
Date
Aug 28, 2008, 07:29 UTC
Message-ID
<200808280929.07898.simon@lst.de>
In-Reply-To
<1219876572-24736-1-git-send-email-torarvid@gmail.com>
On Thursday 28 August 2008 00:36:12 Tor Arvid Lund wrote:
Show 5 quoted lines
> When this option is passed to git p4 clone, the checkout at the end would
> previously fail. This patch fixes it by optionally creating the master
> branch from refs/heads/p4/master, which is the correct one for this option.
>
> Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Good catch :)
Acked-By: Simon Hausmann <simon@lst.de>
Simon
Show 23 quoted lines
>  contrib/fast-import/git-p4 |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index 46136d4..c4b8b4c 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -1733,8 +1733,12 @@ class P4Clone(P4Sync):
>          if not P4Sync.run(self, depotPaths):
>              return False
>          if self.branch != "master":
> -            if gitBranchExists("refs/remotes/p4/master"):
> -                system("git branch master refs/remotes/p4/master")
> +            if self.importIntoRemotes:
> +                masterbranch = "refs/remotes/p4/master"
> +            else:
> +                masterbranch = "refs/heads/p4/master"
> +            if gitBranchExists(masterbranch):
> +                system("git branch master %s" % masterbranch)
>                  system("git checkout -f")
>              else:
>                  print "Could not detect main branch. No checkout/master
> branch created."
Previous: Tor Arvid Lund
Message 2 of 2 in “git-p4: Fix checkout bug when using --import-local.”
  1. git-p4: Fix checkout bug when using --import-local.Tor Arvid Lund, Aug 27, 2008
  2. Simon HausmannAug 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.