diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-21 17:00:40 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-21 17:00:40 +0200 |
commit | 5e52a00c81d032b47f1bc352369be3ff8eb87b27 (patch) | |
tree | fd0d54729e7416d2ddf21da4bfdc0333a7d0daae | |
parent | 6fcbda4e363262a339d1cacbf7d2945ec3bd83f0 (diff) | |
download | gitpython-5e52a00c81d032b47f1bc352369be3ff8eb87b27.tar.gz |
repo.is_dirty: fixed incorrect check of a dirty working tree, previously it would compare HEAD against the working tree, not the index which was intended
-rw-r--r-- | TODO | 7 | ||||
-rw-r--r-- | lib/git/repo.py | 4 |
2 files changed, 10 insertions, 1 deletions
@@ -59,5 +59,12 @@ Tree testing whether it raises on invalid input ? ). See 6dc7799d44e1e5b9b77fd19b47309df69ec01a99 * Derive from Iterable, simple pipe it through to Commit objects and iterate using commit.tree. + +Testing +------- +* Create a test-repository that can be written to and changed in addition to the normal + read-only testing scheme that operates on the own repository. Doing this could be a simple + as forking a shared repo in a tmp directory. In that moment, we probably want to + facility committing and checkouts as well. diff --git a/lib/git/repo.py b/lib/git/repo.py index 47b99ea4..956a3341 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -432,11 +432,13 @@ class Repo(object): # start from the one which is fastest to evaluate default_args = ('--abbrev=40', '--full-index', '--raw') if index: + # diff index against HEAD if len(self.git.diff('HEAD', '--cached', *default_args)): return True # END index handling if working_tree: - if len(self.git.diff('HEAD', *default_args)): + # diff index against working tree + if len(self.git.diff(*default_args)): return True # END working tree handling if untracked_files: |