summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-05-10 19:32:45 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-05-10 19:32:51 +0200
commit837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8 (patch)
treebecab82b67846625c68815aba91cd52eac3405b7 /lib/git/repo.py
parent63761f4cb6f3017c6076ecd826ed0addcfb03061 (diff)
downloadgitpython-837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8.tar.gz
repo: added test with some basic assertions for empty repositories these
repo.is_dirty: Will not fail on empty repo ( anymore ) index.entries: will just be empty if the repository is empty refs: added to_full_path method which can be used to create fully synthetic instances of Reference types, added a test for it Converted all touched files to spaces, which is why git reports so many changed files. Actually I was thinking every file would use spaces, but apparently not
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 2beda9be..4ab656c4 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -526,7 +526,8 @@ class Repo(object):
default_args = ('--abbrev=40', '--full-index', '--raw')
if index:
# diff index against HEAD
- if len(self.git.diff('HEAD', '--cached', *default_args)):
+ if os.path.isfile(self.index.path) and \
+ len(self.git.diff('HEAD', '--cached', *default_args)):
return True
# END index handling
if working_tree: