t2200: check that "add -u" limits itself to subdirectory
This behavior is due to change in the future, but let's test it anyway. That helps make sure we do not accidentally switch the behavior too soon while we are working in the area, and it means that we can easily verify the change when we do make it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 14, 2013 at 02:44 UTC
7bf7a92f69f8b0af7169af390e53397698fcfa95
1 file changed
+16
t/t2200-add-update.sh
+16
@@ -80,6 +80,22 @@ test_expect_success 'change gets noticed' '
80
81
'
82
83
+# Note that this is scheduled to change in Git 2.0, when
84
+# "git add -u" will become full-tree by default.
85
+test_expect_success 'non-limited update in subdir leaves root alone' '
86
+ (
87
+ cd dir1 &&
88
+ echo even more >>sub2 &&
89
+ git add -u
90
+ ) &&
91
+ cat >expect <<-\EOF &&
92
+ check
93
+ top
94
+ EOF
95
+ git diff-files --name-only >actual &&
96
+ test_cmp expect actual
97
+'
98
+
99
test_expect_success SYMLINKS 'replace a file with a symlink' '
100
101
rm foo &&