Skip to content

Commit 33dfff8

Browse files
Add tests for pathspec magic w/ tree.
1 parent 989ef9a commit 33dfff8

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

test-repo

test/functional/tree_test.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,34 @@ def test_tree_subdir
2929
refute_empty(stdout_s)
3030
end
3131

32+
def test_tree_exclude_ext_pathspec
33+
cmd = GitWho.new(GitWho.built_bin_path, TestRepo.path)
34+
stdout_s = cmd.run 'tree', '--', 'exclude-ext', ':!*.py'
35+
refute_empty(stdout_s)
36+
end
37+
38+
def test_tree_exclude_ext_pathspec_longform
39+
cmd = GitWho.new(GitWho.built_bin_path, TestRepo.path)
40+
stdout_s = cmd.run 'tree', '--', 'exclude-ext', ':(exclude)*.py'
41+
refute_empty(stdout_s)
42+
end
43+
44+
def test_tree_exclude_ext_pathspec_no_concurrent
45+
cmd = GitWho.new(GitWho.built_bin_path, TestRepo.path)
46+
stdout_s = cmd.run 'tree', '--', 'exclude-ext', ':!*.py', n_procs: 1
47+
refute_empty(stdout_s)
48+
end
49+
50+
def test_exclude_ext_pathspec_trailing_slash
51+
skip("git ls-files bug")
52+
53+
# This doesn't work because ls-files doesn't output anything. But it works
54+
# if you put the exclude magic pathspec first. Bug with git ls-files?
55+
cmd = GitWho.new(GitWho.built_bin_path, TestRepo.path)
56+
stdout_s = cmd.run 'tree', '--', 'exclude-ext/', ':!*.py'
57+
refute_empty(stdout_s)
58+
end
59+
3260
all_flag_combos = GitWho.generate_args_cartesian_product([
3361
SHOW_ALL_FLAGS,
3462
MODE_FLAGS,

0 commit comments

Comments
 (0)