3 test_description
='git add -u with path limiting
5 This test creates a working tree state with three files:
7 top (previously committed, modified)
8 dir/sub (previously committed, modified)
11 and issues a git add -u with path limiting on "dir" to add
12 only the updates to dir/sub.'
16 test_expect_success
'setup' '
19 echo initial >dir/sub &&
20 git add dir/sub top &&
21 git-commit -m initial &&
23 echo changed >dir/sub &&
27 test_expect_success
'update' 'git add -u dir'
29 test_expect_success
'update touched correct path' \
30 'test "`git diff-files --name-status dir/sub`" = ""'
32 test_expect_success
'update did not touch other tracked files' \
33 'test "`git diff-files --name-status top`" = "M top"'
35 test_expect_success
'update did not touch untracked files' \
36 'test "`git diff-files --name-status dir/other`" = ""'