]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3003-ls-files-exclude.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t3003-ls-files-exclude.sh
CommitLineData
b5227d80
JK
1#!/bin/sh
2
3test_description='ls-files --exclude does not affect index files'
4. ./test-lib.sh
5
6test_expect_success 'create repo with file' '
7 echo content >file &&
8 git add file &&
9 git commit -m file &&
10 echo modification >file
11'
12
13check_output() {
14test_expect_success "ls-files output contains file ($1)" "
15 echo '$2' >expect &&
16 git ls-files --exclude-standard --$1 >output &&
17 test_cmp expect output
18"
19}
20
21check_all_output() {
22 check_output 'cached' 'file'
23 check_output 'modified' 'file'
24}
25
26check_all_output
27test_expect_success 'add file to gitignore' '
28 echo file >.gitignore
29'
30check_all_output
31
500348aa
JK
32test_expect_success 'ls-files -i lists only tracked-but-ignored files' '
33 echo content >other-file &&
34 git add other-file &&
35 echo file >expect &&
36 git ls-files -i --exclude-standard >output &&
37 test_cmp expect output
38'
39
b5227d80 40test_done