1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

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 <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Luke Diamand 2020-01-30 11:50:34 +00:00 committed by Junio C Hamano
parent 19fa5ac333
commit 43f33e492a

View file

@ -3563,7 +3563,8 @@ def importRevisions(self, args, branch_arg_given):
changes = []
if len(self.changesFile) > 0:
output = open(self.changesFile).readlines()
with open(self.changesFile) as f:
output = f.readlines()
changeSet = set()
for line in output:
changeSet.add(int(line))