Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adding assertions to existing test case to cover this change
  • Loading branch information
thetwoj committed Oct 21, 2019
commit 8040f6ba0a0a24cc8cd5744d33eebee8871a253b
7 changes: 6 additions & 1 deletion git/test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ def test_diff_with_staged_file(self, rw_dir):

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:
Expand Down