From 6c9fcd7745d2f0c933b46a694f77f85056133ca5 Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Wed, 21 Mar 2012 17:45:04 +0100 Subject: Fix issue #41: repo.is_dirty() on empty repository with stashed files --- git/repo/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/repo/base.py') diff --git a/git/repo/base.py b/git/repo/base.py index 71492fe8..2296cf29 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -499,8 +499,8 @@ class Repo(object): default_args = ('--abbrev=40', '--full-index', '--raw') if index: # diff index against HEAD - if isfile(self.index.path) and self.head.is_valid() and \ - len(self.git.diff('HEAD', '--cached', *default_args)): + if isfile(self.index.path) and \ + len(self.git.diff('--cached', *default_args)): return True # END index handling if working_tree: -- cgit v1.2.1