I receive an error while trying to use gitpython to check if a repository is dirty, i.e. has uncommitted changed to tracked files:
import git
repo = git.Repo('')
print repo.is_dirty()
The error:
Traceback (most recent call last):
File "C:\dev\my_prog\test.py", line 8, in <module>
print repo.is_dirty()
File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\repo\base.py", line 502, in is_dirty
len(self.git.diff('HEAD', '--cached', *default_args)):
File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\cmd.py", line 227, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\cmd.py", line 456, in _call_process
return self.execute(call, **_kwargs)
File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\cmd.py", line 377, in execute
raise GitCommandError(command, status, stderr_value)
git.exc.GitCommandError: 'git diff HEAD --cached --abbrev=40 --full-index --raw' returned exit status 1:
How come? What could be the problem?
Notice I'm working on Windows 7 with msysgit