summaryrefslogtreecommitdiff
path: root/lib/git/index.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-23 11:55:00 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-23 11:55:00 +0100
commit5020eb8ef37571154dd7eff63486f39fc76fea7f (patch)
tree4c3e09273afe45d9c3af12907b972d913e85b67e /lib/git/index.py
parent3bee808e15707d849c00e8cea8106e41dd96d771 (diff)
downloadgitpython-5020eb8ef37571154dd7eff63486f39fc76fea7f.tar.gz
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
Diffstat (limited to 'lib/git/index.py')
-rw-r--r--lib/git/index.py11
1 files changed, 9 insertions, 2 deletions
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):