[PATCH 6 of 7] tests: add test cases for binary diffs in Git mode

Alexander Fomin afomin at fb.com
Tue Mar 21 13:08:39 EDT 2017


# HG changeset patch
# User Alexander Fomin <afomin at fb.com>
# Date 1490113366 25200
#      Tue Mar 21 09:22:46 2017 -0700
# Node ID e9044ade1523e847877f4eee1d4e06734e2aa4cd
# Parent  98301edf86daecef6ef43357b0934c351f58574d
tests: add test cases for binary diffs in Git mode

This patch adds some test cases to verify binary diffs are not generated in
Git mode unless explicitly requested by user (issue5510).

diff --git a/tests/test-diff-binary-file.t b/tests/test-diff-binary-file.t
--- a/tests/test-diff-binary-file.t
+++ b/tests/test-diff-binary-file.t
@@ -19,6 +19,10 @@
 
   $ hg diff --nodates -r 0 -r 2
 
+  $ hg diff --git -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  Binary file binfile.bin has changed
+
   $ hg diff --git -a -r 0 -r 1
   diff --git a/binfile.bin b/binfile.bin
   index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356
@@ -44,6 +48,10 @@
   diff --git a/binfile.bin b/binfile.bin
   Binary file binfile.bin has changed
 
+  $ HGPLAIN=1 hg diff --git -r 0 -r 1
+  diff --git a/binfile.bin b/binfile.bin
+  Binary file binfile.bin has changed
+
   $ HGPLAIN=1 hg diff --config diff.nobinary=True --git -a -r 0 -r 1
   diff --git a/binfile.bin b/binfile.bin
   index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356


More information about the Mercurial-devel mailing list