Skip to content

Commit

Permalink
Shortcut the case where we have no origin branch
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
  • Loading branch information
Simon Hausmann committed May 25, 2007
1 parent 0126510 commit d414c74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,15 @@ 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/"
else:
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")
Expand All @@ -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:
Expand Down

0 comments on commit d414c74

Please sign in to comment.