]>
Commit | Line | Data |
---|---|---|
93c44d49 JK |
1 | #!/bin/sh |
2 | ||
3 | test_description='git-add -u with path limiting | |
4 | ||
5 | This test creates a working tree state with three files: | |
6 | ||
7 | top (previously committed, modified) | |
8 | dir/sub (previously committed, modified) | |
9 | dir/other (untracked) | |
10 | ||
11 | and issues a git-add -u with path limiting on "dir" to add | |
12 | only the updates to dir/sub.' | |
13 | ||
14 | . ./test-lib.sh | |
15 | ||
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 | |
25 | ' | |
26 | ||
27 | test_expect_success 'update' 'git-add -u dir' | |
28 | ||
29 | test_expect_success 'update touched correct path' \ | |
30 | 'test "`git-diff-files --name-status dir/sub`" = ""' | |
31 | ||
32 | test_expect_success 'update did not touch other tracked files' \ | |
33 | 'test "`git-diff-files --name-status top`" = "M top"' | |
34 | ||
35 | test_expect_success 'update did not touch untracked files' \ | |
36 | 'test "`git-diff-files --name-status dir/other`" = ""' | |
37 | ||
38 | test_done |