Skip to content

Commit 43f33e4

Browse files
luked99gitster
authored andcommitted
git-p4: avoid leak of file handle when cloning
Spotted by Eric Sunshine: https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/ Signed-off-by: Luke Diamand <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 19fa5ac commit 43f33e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: git-p4.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,8 @@ def importRevisions(self, args, branch_arg_given):
35633563
changes = []
35643564

35653565
if len(self.changesFile) > 0:
3566-
output = open(self.changesFile).readlines()
3566+
with open(self.changesFile) as f:
3567+
output = f.readlines()
35673568
changeSet = set()
35683569
for line in output:
35693570
changeSet.add(int(line))

0 commit comments

Comments
 (0)