aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-07-14 19:46:23 +0200
committerJakob Unterwurzacher2025-07-14 19:46:23 +0200
commit2e998b6fd5b0627d54cf9b6cda9dc348f6632e1d (patch)
treedce3404bde14669681b980af1003e91276904842
parenta2efa0e5113b0efc96cac9618dd8d438310b417f (diff)
tests: reverse: add TestIssue927MinimalNotDir2go-git-gitignore
-rw-r--r--tests/reverse/exclude_test.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/reverse/exclude_test.go b/tests/reverse/exclude_test.go
index da05233..ba6d0e3 100644
--- a/tests/reverse/exclude_test.go
+++ b/tests/reverse/exclude_test.go
@@ -290,7 +290,9 @@ func TestIssue927(t *testing.T) {
doTestExcludeTestFs(t, "-exclude-wildcard", patterns, tree)
}
-func TestIssue927Minimal(t *testing.T) {
+// Subset of TestIssue927 to repro the "!dir/" issue
+// https://github.com/go-git/go-git/issues/1596
+func TestIssue927MinimalNotDir(t *testing.T) {
patterns := strings.Split(`dir/*
!dir/`, "\n")
var tree directoryTree
@@ -306,3 +308,21 @@ func TestIssue927Minimal(t *testing.T) {
}
doTestExcludeTestFs(t, "-exclude-wildcard", patterns, tree)
}
+
+func TestIssue927MinimalNotDir2(t *testing.T) {
+ patterns := strings.Split(`.config/conky/*
+!.config/conky/
+!.config/conky/conkyrc`, "\n")
+ var tree directoryTree
+ // visible are plaintext paths that should be visible in the encrypted view
+ tree.visibleDirs = []string{}
+ tree.visibleFiles = []string{
+ ".config/conky/conkyrc",
+ }
+ // hidden are plaintext paths that should be hidden in the encrypted view
+ tree.hiddenDirs = []string{}
+ tree.hiddenFiles = []string{
+ ".config/conky/xxx",
+ }
+ doTestExcludeTestFs(t, "-exclude-wildcard", patterns, tree)
+}