summaryrefslogtreecommitdiff
path: root/git/test/test_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/test_diff.py')
-rw-r--r--git/test/test_diff.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index 56e51289..e4e7556d 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -68,7 +68,12 @@ class TestDiff(TestBase):
with open(fp, 'w') as fs:
fs.write("Hola Mundo")
- r.git.commit(all=True, message="change on master")
+ r.git.add(Git.polish_url(fp))
+ self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 1,
+ "create_patch should generate patch of diff to HEAD")
+ r.git.commit(message="change on master")
+ self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 0,
+ "create_patch should generate no patch, already on HEAD")
r.git.checkout('HEAD~1', b='topic')
with open(fp, 'w') as fs: