summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTor Arvid Lund <torarvid@gmail.com>2008-08-28 00:36:12 +0200
committerJunio C Hamano <gitster@pobox.com>2008-08-29 00:15:47 -0700
commite990501312e22cfa910d88dc7143bc4eb3632ae1 (patch)
tree8dd43384fe2c55ed5bde3117c261c3b575f11185 /contrib
parent61c5d431deb0437b35c18d268c1957eefd1f4b91 (diff)
downloadgit-e990501312e22cfa910d88dc7143bc4eb3632ae1.tar.gz
git-p4: Fix checkout bug when using --import-local.
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> Acked-By: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p48
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c1d24b38f3..2216cacba7 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1748,8 +1748,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."