summaryrefslogtreecommitdiff
path: root/git/test/test_diff.py
diff options
context:
space:
mode:
authorJJ Graham <thetwoj@gmail.com>2019-10-21 17:28:00 -0500
committerSebastian Thiel <sebastian.thiel@icloud.com>2019-10-22 12:39:27 +0200
commit38c624f74061a459a94f6d1dac250271f5548dab (patch)
treec7456ccc7f89e8d8eafe4683f4c5250906561985 /git/test/test_diff.py
parent14d7034adc2698c1e7dd13570c23d217c753e932 (diff)
downloadgitpython-38c624f74061a459a94f6d1dac250271f5548dab.tar.gz
Adding assertions to existing test case to cover this change
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: