Skip to content

Commit 6620d9f

Browse files
committed
Merge pull request #193 from maxyz/fix-issue-41_master
Fix issue #41: repo.is_dirty() on empty repository with stashed files
2 parents a82b0df + f9ec0af commit 6620d9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git/db/cmd/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False):
662662
default_args = ('--abbrev=40', '--full-index', '--raw')
663663
if index:
664664
# diff index against HEAD
665-
if isfile(self.index.path) and self.head.is_valid() and \
666-
len(self.git.diff('HEAD', '--cached', *default_args)):
665+
if isfile(self.index.path) and \
666+
len(self.git.diff('--cached', *default_args)):
667667
return True
668668
# END index handling
669669
if working_tree:

0 commit comments

Comments
 (0)