code: def _write_path_to_stdin(self, proc, filepath, item, fmakeexc, fprogress,
                               read_from_stdout=True):
          
  
          fprogress(filepath, False, item)
          rval = None
          try:
              proc.stdin.write(("%s\n" % filepath).encode(defenc))
          except IOError:
              # pipe broke, usually because some error happened
              raise fmakeexc()
          # END write exception handling
          proc.stdin.flush()
          if read_from_stdout:
              rval = proc.stdout.readline().strip()
          fprogress(filepath, True, item)
          return rval
docs: Write path to proc.stdin and make sure it processes the item, including progress.
  
          :return: stdout string
          :param read_from_stdout: if True, proc.stdout will be read after the item
              was sent to stdin. In that case, it will return None
          :note: There is a bug in git-update-index that prevents it from sending
              reports just in time. This is why we have a version that tries to
              read stdout and one which doesn't. In fact, the stdout is not
              important as the piped-in files are processed anyway and just in time
          :note: Newlines are essential here, gits behaviour is somewhat inconsistent
              on this depending on the version, hence we try our best to deal with
              newlines carefully. Usually the last newline will not be sent, instead
              we will close stdin to break the pipe.