Subject: [PATCH 1/6] t2200: check that "add -u" limits itself to subdirectory

From: Jonathan Nieder <[email-masked]>
Date: Tue, 19 Mar 2013 15:44:51 -0700

From: Jeff King <[email-masked]>
Date: Thu, 14 Mar 2013 02:44:04 -0400

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 <[email-masked]>
Signed-off-by: Junio C Hamano <[email-masked]>
Signed-off-by: Jonathan Nieder <[email-masked]>
---
Unchanged, only included for reference.

 t/t2200-add-update.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh
index 4cdebda..c317254 100755
--- a/t/t2200-add-update.sh
+++ b/t/t2200-add-update.sh
@@ -80,6 +80,22 @@ test_expect_success 'change gets noticed' '
 
 '
 
+# Note that this is scheduled to change in Git 2.0, when
+# "git add -u" will become full-tree by default.
+test_expect_success 'non-limited update in subdir leaves root alone' '
+	(
+		cd dir1 &&
+		echo even more >>sub2 &&
+		git add -u
+	) &&
+	cat >expect <<-\EOF &&
+	check
+	top
+	EOF
+	git diff-files --name-only >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success SYMLINKS 'replace a file with a symlink' '
 
 	rm foo &&
-- 
1.8.2.rc3