Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t2104-update-index-skip-worktree.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t2104-update-index-skip-worktree.sh` 70 lines · 1366 bytes Raw Blame History 1 #!/bin/sh 2 # 3 # Copyright (c) 2008 Nguyễn Thái Ngọc Duy 4 # 5 6 test_description='skip-worktree bit test' 7 8 . ./test-lib.sh 9 10 sane_unset GIT_TEST_SPLIT_INDEX 11 12 test_set_index_version () { 13 GIT_INDEX_VERSION="$1" 14 export GIT_INDEX_VERSION 15 } 16 17 test_set_index_version 3 18 19 test_expect_success 'setup' ' 20 cat >expect.full <<-\EOF && 21 H 1 22 H 2 23 H sub/1 24 H sub/2 25 EOF 26 27 cat >expect.skip <<-\EOF && 28 S 1 29 H 2 30 S sub/1 31 H sub/2 32 EOF 33 34 mkdir sub && 35 touch ./1 ./2 sub/1 sub/2 && 36 git add 1 2 sub/1 sub/2 && 37 git ls-files -t >actual && 38 test_cmp expect.full actual 39 ' 40 41 test_expect_success 'index is at version 2' ' 42 test "$(git update-index --show-index-version)" = 2 43 ' 44 45 test_expect_success 'update-index --skip-worktree' ' 46 git update-index --skip-worktree 1 sub/1 && 47 git ls-files -t >actual && 48 test_cmp expect.skip actual 49 ' 50 51 test_expect_success 'index is at version 3 after having some skip-worktree entries' ' 52 test "$(git update-index --show-index-version)" = 3 53 ' 54 55 test_expect_success 'ls-files -t' ' 56 git ls-files -t >actual && 57 test_cmp expect.skip actual 58 ' 59 60 test_expect_success 'update-index --no-skip-worktree' ' 61 git update-index --no-skip-worktree 1 sub/1 && 62 git ls-files -t >actual && 63 test_cmp expect.full actual 64 ' 65 66 test_expect_success 'index version is back to 2 when there is no skip-worktree entry' ' 67 test "$(git update-index --show-index-version)" = 2 68 ' 69 70 test_done