diff options
author | Luke Diamand <luke@diamand.org> | 2020-01-29 11:12:41 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-30 12:20:57 -0800 |
commit | 837b3a6376804ec70b88f06c3f702a38c59196c3 (patch) | |
tree | 33e714c46354fc840dd5b6620b0e25da0932c97a /git-p4.py | |
parent | c7a62075917b3340f908093f63f1161c44ed1475 (diff) | |
download | git-837b3a6376804ec70b88f06c3f702a38c59196c3.tar.gz |
git-p4: make closeStreams() idempotent
Ensure that we can safely call self.closeStreams() multiple times, and
can also call it even if there is no git fast-import stream at all.
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-x | git-p4.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3549,11 +3549,14 @@ class P4Sync(Command, P4UserMap): self.gitError = self.importProcess.stderr def closeStreams(self): + if self.gitStream is None: + return self.gitStream.close() if self.importProcess.wait() != 0: die("fast-import failed: %s" % self.gitError.read()) self.gitOutput.close() self.gitError.close() + self.gitStream = None def run(self, args): if self.importIntoRemotes: |