interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t3003-ls-files-exclude.sh

41 lines · 837 bytes Raw Blame History
1#!/bin/sh
2
3test_description='ls-files --exclude does not affect index files'
4
5. ./test-lib.sh
6
7test_expect_success 'create repo with file' '
8 echo content >file &&
9 git add file &&
10 git commit -m file &&
11 echo modification >file
12'
13
14check_output() {
15test_expect_success "ls-files output contains file ($1)" "
16 echo '$2' >expect &&
17 git ls-files --exclude-standard --$1 >output &&
18 test_cmp expect output
19"
20}
21
22check_all_output() {
23 check_output 'cached' 'file'
24 check_output 'modified' 'file'
25}
26
27check_all_output
28test_expect_success 'add file to gitignore' '
29 echo file >.gitignore
30'
31check_all_output
32
33test_expect_success 'ls-files -i -c lists only tracked-but-ignored files' '
34 echo content >other-file &&
35 git add other-file &&
36 echo file >expect &&
37 git ls-files -i -c --exclude-standard >output &&
38 test_cmp expect output
39'
40
41test_done