Skip to content

Commit 38c624f

Browse files
thetwojByron
authored andcommitted
Adding assertions to existing test case to cover this change
1 parent 14d7034 commit 38c624f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git/test/test_diff.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ def test_diff_with_staged_file(self, rw_dir):
6868

6969
with open(fp, 'w') as fs:
7070
fs.write("Hola Mundo")
71-
r.git.commit(all=True, message="change on master")
71+
r.git.add(Git.polish_url(fp))
72+
self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 1,
73+
"create_patch should generate patch of diff to HEAD")
74+
r.git.commit(message="change on master")
75+
self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 0,
76+
"create_patch should generate no patch, already on HEAD")
7277

7378
r.git.checkout('HEAD~1', b='topic')
7479
with open(fp, 'w') as fs:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy