Skip to content

Commit f9ec0af

Browse files
fceldamaxyz
authored andcommitted
Fix issue gitpython-developers#41: repo.is_dirty() on empty repository with stashed files
1 parent a82b0df commit f9ec0af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: 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)