Skip to content

Commit 3b650fc

Browse files
Pete Wyckoffgitster
authored andcommitted
git p4: inline listExistingP4GitBranches
It is four lines of code used in only one place. Simplify by including it where it is used. Signed-off-by: Pete Wyckoff <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c8037e commit 3b650fc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

git-p4.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,13 +2512,6 @@ def getBranchMappingFromGitBranches(self):
25122512
branch = branch[len(self.projectName):]
25132513
self.knownBranches[branch] = branch
25142514

2515-
def listExistingP4GitBranches(self):
2516-
# branches holds mapping from name to commit
2517-
branches = p4BranchesInGit(self.importIntoRemotes)
2518-
self.p4BranchesInGit = branches.keys()
2519-
for branch in branches.keys():
2520-
self.initialParents[self.refPrefix + branch] = branches[branch]
2521-
25222515
def updateOptionDict(self, d):
25232516
option_keys = {}
25242517
if self.keepRepoPath:
@@ -2799,7 +2792,12 @@ def run(self, args):
27992792
if args == []:
28002793
if self.hasOrigin:
28012794
createOrUpdateBranchesFromOrigin(self.refPrefix, self.silent)
2802-
self.listExistingP4GitBranches()
2795+
2796+
# branches holds mapping from branch name to sha1
2797+
branches = p4BranchesInGit(self.importIntoRemotes)
2798+
self.p4BranchesInGit = branches.keys()
2799+
for branch in branches.keys():
2800+
self.initialParents[self.refPrefix + branch] = branches[branch]
28032801

28042802
if len(self.p4BranchesInGit) > 1:
28052803
if not self.silent:

0 commit comments

Comments
 (0)