MCPcopy Index your code
hub / github.com/git/git / openStreams

Method openStreams

git-p4.py:4018–4034  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4016 sys.stdout.write("\n")
4017
4018 def openStreams(self):
4019 self.importProcess = subprocess.Popen(["git", "fast-import"],
4020 stdin=subprocess.PIPE,
4021 stdout=subprocess.PIPE,
4022 stderr=subprocess.PIPE)
4023 self.gitOutput = self.importProcess.stdout
4024 self.gitStream = self.importProcess.stdin
4025 self.gitError = self.importProcess.stderr
4026
4027 if bytes is not str:
4028 # Wrap gitStream.write() so that it can be called using `str` arguments
4029 def make_encoded_write(write):
4030 def encoded_write(s):
4031 return write(s.encode() if isinstance(s, str) else s)
4032 return encoded_write
4033
4034 self.gitStream.write = make_encoded_write(self.gitStream.write)
4035
4036 def closeStreams(self):
4037 if self.gitStream is None:

Callers 2

runMethod · 0.95
runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected