--- a/tests/test-import Sat Jan 12 20:43:09 2008 +0100
+++ b/tests/test-import Sat Jan 12 19:35:11 2008 +0100
@@ -153,3 +153,31 @@
hg ci -m brancha
hg import -v tip.patch
cd ..
+
+# Test hunk touching empty files (issue906)
+hg init empty
+cd empty
+touch a
+touch b1
+touch c1
+echo d > d
+hg ci -Am init
+echo a > a
+echo b > b1
+hg mv b1 b2
+echo c > c1
+hg copy c1 c2
+rm d
+touch d
+hg diff --git
+hg ci -m empty
+hg export --git tip > empty.diff
+hg up -C 0
+hg import empty.diff
+for name in a b1 b2 c1 c2 d;
+do
+ echo % $name file
+ test -f $name && cat $name
+done
+cd ..
+