Documentation/git-add: clarify -u with path limiting
[git/jnareb-git.git] / t / t2200-add-update.sh
blob83005e70d00f5805e26b8873df2598225453fe83
1 #!/bin/sh
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)
9 dir/other (untracked)
11 and issues a git-add -u with path limiting on "dir" to add
12 only the updates to dir/sub.'
14 . ./test-lib.sh
16 test_expect_success 'setup' '
17 echo initial >top &&
18 mkdir dir &&
19 echo initial >dir/sub &&
20 git-add dir/sub top &&
21 git-commit -m initial &&
22 echo changed >top &&
23 echo changed >dir/sub &&
24 echo other >dir/other
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`" = ""'
38 test_done