From 5020eb8ef37571154dd7eff63486f39fc76fea7f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 23 Nov 2009 11:55:00 +0100 Subject: index.checkout: improved parsing of stderr to properly handle more unusual messages - previously it would be more narrow and raise a GitCommandError in cases where it wasnt actually needed --- lib/git/index.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/git/index.py') diff --git a/lib/git/index.py b/lib/git/index.py index fa6bf185..0a7bfe6e 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -1054,9 +1054,16 @@ class IndexFile(LazyMixin, diff.Diffable): endings = (' already exists', ' is not in the cache', ' does not exist at stage', ' is unmerged') for line in stderr.splitlines(): if not line.startswith("git checkout-index: ") and not line.startswith("git-checkout-index: "): - unknown_lines.append(line) + is_a_dir = " is a directory" + unlink_issue = "unable to unlink old '" + if line.endswith(is_a_dir): + failed_files.append(line[:-len(is_a_dir)]) + elif line.startswith(unlink_issue): + failed_files.append(line[len(unlink_issue):line.rfind("'")]) + else: + unknown_lines.append(line) continue - # END unkown lines parsing + # END special lines parsing for e in endings: if line.endswith(e): -- cgit v1.2.1