Skip to content

Commit 6c9fcd7

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git/repo/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False):
499499
default_args = ('--abbrev=40', '--full-index', '--raw')
500500
if index:
501501
# diff index against HEAD
502-
if isfile(self.index.path) and self.head.is_valid() and \
503-
len(self.git.diff('HEAD', '--cached', *default_args)):
502+
if isfile(self.index.path) and \
503+
len(self.git.diff('--cached', *default_args)):
504504
return True
505505
# END index handling
506506
if working_tree:

0 commit comments

Comments
 (0)