# HG changeset patch
# User Sushil khanchi <sushilkhanchi97@gmail.com>
# Date 2021-02-16 10:07:19
# 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 --git a/tests/test-diff-unified.t b/tests/test-diff-unified.t
--- a/tests/test-diff-unified.t
+++ b/tests/test-diff-unified.t
@@ -456,3 +456,26 @@ be broken up
     .
 
   $ 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 ..