Skip to content

Commit 991a2de

Browse files
Pete Wyckoffgitster
authored andcommitted
git p4: rearrange and simplify hasOrigin handling
Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 46738bd commit 991a2de

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

git-p4.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,23 +2748,23 @@ def run(self, args):
27482748
self.changeRange = ""
27492749
self.initialParent = ""
27502750
self.previousDepotPaths = []
2751+
self.hasOrigin = False
27512752

27522753
# map from branch depot path to parent branch
27532754
self.knownBranches = {}
27542755
self.initialParents = {}
2755-
self.hasOrigin = originP4BranchesExist()
2756-
if not self.syncWithOrigin:
2757-
self.hasOrigin = False
27582756

27592757
if self.importIntoRemotes:
27602758
self.refPrefix = "refs/remotes/p4/"
27612759
else:
27622760
self.refPrefix = "refs/heads/p4/"
27632761

2764-
if self.syncWithOrigin and self.hasOrigin:
2765-
if not self.silent:
2766-
print "Syncing with origin first by calling git fetch origin"
2767-
system("git fetch origin")
2762+
if self.syncWithOrigin:
2763+
self.hasOrigin = originP4BranchesExist()
2764+
if self.hasOrigin:
2765+
if not self.silent:
2766+
print 'Syncing with origin first, using "git fetch origin"'
2767+
system("git fetch origin")
27682768

27692769
if len(self.branch) == 0:
27702770
self.branch = self.refPrefix + "master"

0 commit comments

Comments
 (0)