vcs-svn: simplify repo_modify_path and repo_copy
[git/raj.git] / t / t2104-update-index-skip-worktree.sh
blob1d0879be0687267372eac27bec3ea313557e79ee
1 #!/bin/sh
3 # Copyright (c) 2008 Nguyễn Thái Ngọc Duy
6 test_description='skip-worktree bit test'
8 . ./test-lib.sh
10 cat >expect.full <<EOF
11 H 1
12 H 2
13 H sub/1
14 H sub/2
15 EOF
17 cat >expect.skip <<EOF
18 S 1
19 H 2
20 S sub/1
21 H sub/2
22 EOF
24 test_expect_success 'setup' '
25 mkdir sub &&
26 touch ./1 ./2 sub/1 sub/2 &&
27 git add 1 2 sub/1 sub/2 &&
28 git ls-files -t | test_cmp expect.full -
31 test_expect_success 'index is at version 2' '
32 test "$(test-index-version < .git/index)" = 2
35 test_expect_success 'update-index --skip-worktree' '
36 git update-index --skip-worktree 1 sub/1 &&
37 git ls-files -t | test_cmp expect.skip -
40 test_expect_success 'index is at version 3 after having some skip-worktree entries' '
41 test "$(test-index-version < .git/index)" = 3
44 test_expect_success 'ls-files -t' '
45 git ls-files -t | test_cmp expect.skip -
48 test_expect_success 'update-index --no-skip-worktree' '
49 git update-index --no-skip-worktree 1 sub/1 &&
50 git ls-files -t | test_cmp expect.full -
53 test_expect_success 'index version is back to 2 when there is no skip-worktree entry' '
54 test "$(test-index-version < .git/index)" = 2
57 test_done