From 837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 10 May 2010 19:32:45 +0200 Subject: 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 --- lib/git/repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/git/repo.py') 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: -- cgit v1.2.1