summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-25 11:36:42 +0200
committerLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-25 11:36:42 +0200
commitd414c74afd8610c8c22dadf62b5ba8c6efa59e75 (patch)
tree18fe2350903ffc449a63fa58b5c4b41d0f25bdbf /contrib/fast-import
parentMake --with-origin the default for syncing. (diff)
downloadtgif-d414c74afd8610c8c22dadf62b5ba8c6efa59e75.tar.xz
Shortcut the case where we have no origin branch
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p46
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index ed5a5c593c..d99237c632 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -844,6 +844,7 @@ class P4Sync(Command):
# map from branch depot path to parent branch
self.knownBranches = {}
self.initialParents = {}
+ self.hasOrigin = gitBranchExists("origin")
if self.importIntoRemotes:
self.refPrefix = "refs/remotes/p4/"
@@ -851,7 +852,7 @@ class P4Sync(Command):
self.refPrefix = "refs/heads/"
if self.syncWithOrigin:
- if gitBranchExists("origin"):
+ if self.hasOrigin:
if not self.silent:
print "Syncing with origin first by calling git fetch origin"
system("git fetch origin")
@@ -868,7 +869,8 @@ class P4Sync(Command):
createP4HeadRef = True
if len(args) == 0:
- self.createOrUpdateBranchesFromOrigin()
+ if self.hasOrigin:
+ self.createOrUpdateBranchesFromOrigin()
self.listExistingP4GitBranches()
if len(self.p4BranchesInGit) > 1: