# HG changeset patch # User Sushil khanchi # Date 1613470039 -19800 # Node ID df44bac9413df8b02df8cf5df9ba4379e86f54eb # Parent 6c8faeea6652798bbfc384d6d2c17cdf3dfb513b tests: add a test to demonstrate a bug in `hg diff --git` (issue6486) Issue url: https://bz.mercurial-scm.org/show_bug.cgi?id=6486 This will be fixed in next patch. Differential Revision: https://phab.mercurial-scm.org/D10000 diff -r 6c8faeea6652 -r df44bac9413d tests/test-diff-unified.t --- a/tests/test-diff-unified.t Fri Feb 19 10:04:53 2021 -0500 +++ b/tests/test-diff-unified.t Tue Feb 16 15:37:19 2021 +0530 @@ -456,3 +456,26 @@ . $ cd .. + +Make sure `hg diff --git` differentiate "file did not exists" and "file is empty" +for git blob oids + + $ hg init bloboids + $ cd bloboids + + $ touch a + $ hg ci -Am "empty a" + adding a + $ hg diff -c 0 --git --config experimental.extendedheader.index=full | grep index + index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 + +Make sure `hg diff --git` differentiate "file was empty" and "file is removed" +for git blob oids + + $ rm a + $ hg ci -Am "removed a" + removing a + $ hg diff -c 1 --git --config experimental.extendedheader.index=full | grep index + index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 + + $ cd ..