-
-
Notifications
You must be signed in to change notification settings - Fork 933
Diff fails on empty repository. #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually, >>> r.index.diff(None, staged=True)
[<git.diff.Diff object at 0x2a86c80>] But #!/usr/bin/python
import git
import os
os.system("rm -rf repo/")
r = git.Repo.init("repo")
os.system("echo foo > repo/foo")
os.system("echo bar > repo/bar")
assert not r.is_dirty()
r.index.add(["foo"])
assert r.is_dirty()
r.index.commit("foo messsage")
assert not r.is_dirty()
r.index.add(["bar"])
assert r.is_dirty() |
Ah, I must have missed out on the |
…y with stashed files
…y with stashed files
Fix issue #41: repo.is_dirty() on empty repository with stashed files
Fix issue #41: repo.is_dirty() on empty repository with stashed files
Even though plenty of work has been done on this already, there is no test-case yet to truly verify this works. It should be done when working on 0.3.5. |
A lot of time has passed, and plenty of changes were applied to |
If you have an empty repository (
git init
in an empty folder), then add files through GitPython, the repository isn't registered as "dirty" and diffs come back empty. For example:The index.entries property shows the newly added file, but there doesn't seem to be a way to turn it into "this file has been added, but not committed".
The text was updated successfully, but these errors were encountered: