diff options
Diffstat (limited to 'lib/git')
-rw-r--r-- | lib/git/index.py | 13 | ||||
-rw-r--r-- | lib/git/utils.py | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/git/index.py b/lib/git/index.py index 9748df9f..334e84aa 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -926,7 +926,7 @@ class IndexFile(LazyMixin, diff.Diffable): self._write_path_to_stdin(proc, filepath, filepath, make_exc, fprogress, read_from_stdout=False) added_files.append(filepath) # END for each filepath - self._flush_stdin_and_wait(proc) # ignore stdout + self._flush_stdin_and_wait(proc, ignore_stdout=True) # ignore stdout # force rereading our entries once it is all done del(self.entries) @@ -978,7 +978,7 @@ class IndexFile(LazyMixin, diff.Diffable): if not progress_sent: fprogress(entry.path, True, entry) # END for each enty - self._flush_stdin_and_wait(proc) + self._flush_stdin_and_wait(proc, ignore_stdout=True) entries_added.extend(entries) # END if there are base entries @@ -1059,10 +1059,13 @@ class IndexFile(LazyMixin, diff.Diffable): return Commit.create_from_tree(self.repo, tree_sha, message, parent_commits, head) @classmethod - def _flush_stdin_and_wait(cls, proc): + def _flush_stdin_and_wait(cls, proc, ignore_stdout = False): proc.stdin.flush() proc.stdin.close() - stdout = proc.stdout.read() + stdout = '' + if not ignore_stdout: + stdout = proc.stdout.read() + proc.stdout.close() proc.wait() return stdout @@ -1192,7 +1195,7 @@ class IndexFile(LazyMixin, diff.Diffable): checked_out_files.append(path) # END path is a file # END for each path - self._flush_stdin_and_wait(proc) + self._flush_stdin_and_wait(proc, ignore_stdout=True) handle_stderr(proc, checked_out_files) return checked_out_files diff --git a/lib/git/utils.py b/lib/git/utils.py index b5364c4c..5b061631 100644 --- a/lib/git/utils.py +++ b/lib/git/utils.py @@ -139,7 +139,7 @@ class LockFile(object): raise AssertionError("The lock file at %s could not be read" % lock_file) if pid != os.getpid(): - raise AssertionError("We claim to own the lock at %s, but it was not owned by our process: %i" % (lock_file, os.getpid())) + raise AssertionError("We claim to own the lock at %s, but it was not owned by our process %i, but by %i" % (lock_file, os.getpid(), pid)) return True |