From 86cfe0848be321a8241b1a499b705ae2148bbf53 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Wed, 9 Dec 2020 13:21:15 -0500 Subject: [PATCH] Allow list bugs (#484) * fix allowlist bug --- config/allowlist.go | 2 +- config/default.go | 2 +- config/rule.go | 3 + go.mod | 2 +- go.sum | 2 + scan/commit.go | 11 ++-- scan/filesatcommit.go | 12 ++-- scan/nogit.go | 15 +++-- scan/scan_test.go | 49 ++++++++++++++++- test_data/test_allow_list_docx_no_git.json | 18 ++++++ test_data/test_allow_list_file.json | 18 ++++++ test_data/test_allow_list_file_no_git.json | 18 ++++++ test_data/test_configs/allowlist_docx.toml | 11 ++++ test_data/test_configs/allowlist_files.toml | 11 ++++ test_data/test_only_files_no_git.json | 52 ++++++++++++------ ...ist.json.got => test_regex_allowlist.json} | 0 .../test_repos/test_repo_10/.gitleaks.toml | 11 ++++ test_data/test_repos/test_repo_10/README.md | 1 + test_data/test_repos/test_repo_10/bad.zip | 1 + test_data/test_repos/test_repo_10/dotGit/HEAD | 1 + .../test_repos/test_repo_10/dotGit/bad.zip | 0 .../test_repos/test_repo_10/dotGit/config | 13 +++++ .../test_repo_10/dotGit/description | 1 + .../test_repos/test_repo_10/dotGit/index | Bin 0 -> 397 bytes .../test_repo_10/dotGit/info/exclude | 6 ++ .../test_repos/test_repo_10/dotGit/logs/HEAD | 1 + .../test_repo_10/dotGit/logs/refs/heads/main | 1 + .../dotGit/logs/refs/remotes/origin/HEAD | 1 + ...11838b7e60925aeee8a41a4a2b508b576b4b4c.idx | Bin 0 -> 1436 bytes ...1838b7e60925aeee8a41a4a2b508b576b4b4c.pack | Bin 0 -> 2747 bytes .../test_repo_10/dotGit/packed-refs | 2 + .../test_repo_10/dotGit/refs/heads/main | 1 + .../dotGit/refs/remotes/origin/HEAD | 1 + .../test_repos/test_repo_10/tmp/bad.docx | 1 + 34 files changed, 232 insertions(+), 36 deletions(-) create mode 100644 test_data/test_allow_list_docx_no_git.json create mode 100644 test_data/test_allow_list_file.json create mode 100644 test_data/test_allow_list_file_no_git.json create mode 100644 test_data/test_configs/allowlist_docx.toml create mode 100644 test_data/test_configs/allowlist_files.toml rename test_data/{test_regex_allowlist.json.got => test_regex_allowlist.json} (100%) create mode 100644 test_data/test_repos/test_repo_10/.gitleaks.toml create mode 100644 test_data/test_repos/test_repo_10/README.md create mode 100644 test_data/test_repos/test_repo_10/bad.zip create mode 100644 test_data/test_repos/test_repo_10/dotGit/HEAD create mode 100644 test_data/test_repos/test_repo_10/dotGit/bad.zip create mode 100644 test_data/test_repos/test_repo_10/dotGit/config create mode 100644 test_data/test_repos/test_repo_10/dotGit/description create mode 100644 test_data/test_repos/test_repo_10/dotGit/index create mode 100644 test_data/test_repos/test_repo_10/dotGit/info/exclude create mode 100644 test_data/test_repos/test_repo_10/dotGit/logs/HEAD create mode 100644 test_data/test_repos/test_repo_10/dotGit/logs/refs/heads/main create mode 100644 test_data/test_repos/test_repo_10/dotGit/logs/refs/remotes/origin/HEAD create mode 100644 test_data/test_repos/test_repo_10/dotGit/objects/pack/pack-bb11838b7e60925aeee8a41a4a2b508b576b4b4c.idx create mode 100644 test_data/test_repos/test_repo_10/dotGit/objects/pack/pack-bb11838b7e60925aeee8a41a4a2b508b576b4b4c.pack create mode 100644 test_data/test_repos/test_repo_10/dotGit/packed-refs create mode 100644 test_data/test_repos/test_repo_10/dotGit/refs/heads/main create mode 100644 test_data/test_repos/test_repo_10/dotGit/refs/remotes/origin/HEAD create mode 100644 test_data/test_repos/test_repo_10/tmp/bad.docx diff --git a/config/allowlist.go b/config/allowlist.go index f2761c74..5ffc827f 100644 --- a/config/allowlist.go +++ b/config/allowlist.go @@ -47,7 +47,7 @@ func (a *AllowList) RepoAllowed(repo string) bool { // IgnoreDotGit appends a `.git$` rule to ignore all .git paths. This is used for --no-git scans func (a *AllowList) IgnoreDotGit() error { - re, err := regexp.Compile(".git$") + re, err := regexp.Compile(".git") if err != nil { return err } diff --git a/config/default.go b/config/default.go index 469bd07a..27c3dd03 100644 --- a/config/default.go +++ b/config/default.go @@ -159,6 +159,6 @@ title = "gitleaks config" [allowlist] description = "Allowlisted files" files = ['''^\.?gitleaks.toml$''', - '''(.*?)(jpg|gif|doc|pdf|bin)$''', + '''(.*?)(png|jpg|gif|doc|docx|pdf|bin|xls|pyc|zip)$''', '''(go.mod|go.sum)$'''] ` diff --git a/config/rule.go b/config/rule.go index 09f62ea9..a1a36e34 100644 --- a/config/rule.go +++ b/config/rule.go @@ -79,6 +79,9 @@ func (r *Rule) HasFileOrPathLeakOnly(filePath string) bool { if len(r.Entropies) != 0 { return false } + if r.AllowList.FileAllowed(filepath.Base(filePath)) || r.AllowList.PathAllowed(filePath) { + return false + } return r.HasFileLeak(filepath.Base(filePath)) || r.HasFilePathLeak(filePath) } diff --git a/go.mod b/go.mod index 495abfb4..d599cff2 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/zricethezav/gitleaks/v7 go 1.15 -replace github.com/go-git/go-git/v5 => github.com/zricethezav/go-git/v5 v5.2.1 +replace github.com/go-git/go-git/v5 => github.com/zricethezav/go-git/v5 v5.2.2 require ( github.com/BurntSushi/toml v0.3.1 diff --git a/go.sum b/go.sum index 1f5f6652..40857e8c 100644 --- a/go.sum +++ b/go.sum @@ -68,6 +68,8 @@ github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70 github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/zricethezav/go-git/v5 v5.2.1 h1:snaoKv8ksDSz7NfBRXsBr9Yr8IKEKWRWf1zdhFmcFvI= github.com/zricethezav/go-git/v5 v5.2.1/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= +github.com/zricethezav/go-git/v5 v5.2.2 h1:VOVijF5OpIiHvFZXX94AJezdJ0b0kTyRyVNZ4yaqCRU= +github.com/zricethezav/go-git/v5 v5.2.2/go.mod h1:kh02eMX+wdqqxgNMEyq8YgwlIOsDOa9homkUq1PoTMs= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= diff --git a/scan/commit.go b/scan/commit.go index 45fc1838..5b97d95e 100644 --- a/scan/commit.go +++ b/scan/commit.go @@ -103,14 +103,17 @@ func (cs *CommitScanner) Scan() (Report, error) { // Check the actual content for _, line := range strings.Split(chunk.Content(), "\n") { for _, rule := range cs.cfg.Rules { + if rule.AllowList.FileAllowed(filepath.Base(to.Path())) || + rule.AllowList.PathAllowed(to.Path()) || + rule.AllowList.CommitAllowed(cs.commit.Hash.String()) { + continue + } offender := rule.Inspect(line) if offender == "" { continue } - if cs.cfg.Allowlist.RegexAllowed(line) || - rule.AllowList.FileAllowed(filepath.Base(to.Path())) || - rule.AllowList.PathAllowed(to.Path()) || - rule.AllowList.CommitAllowed(cs.commit.Hash.String()) { + + if cs.cfg.Allowlist.RegexAllowed(line) { continue } diff --git a/scan/filesatcommit.go b/scan/filesatcommit.go index 16a6c710..0a226ea5 100644 --- a/scan/filesatcommit.go +++ b/scan/filesatcommit.go @@ -81,15 +81,19 @@ func (fs *FilesAtCommitScanner) Scan() (Report, error) { for i, line := range strings.Split(content, "\n") { for _, rule := range fs.cfg.Rules { + if rule.AllowList.FileAllowed(filepath.Base(f.Name)) || + rule.AllowList.PathAllowed(f.Name) || + rule.AllowList.CommitAllowed(fs.commit.Hash.String()) { + continue + } + offender := rule.Inspect(line) if offender == "" { continue } - if fs.cfg.Allowlist.RegexAllowed(line) || - rule.AllowList.FileAllowed(filepath.Base(f.Name)) || - rule.AllowList.PathAllowed(f.Name) || - rule.AllowList.CommitAllowed(fs.commit.Hash.String()) { + + if fs.cfg.Allowlist.RegexAllowed(line) { continue } diff --git a/scan/nogit.go b/scan/nogit.go index 82f6a26b..576f3860 100644 --- a/scan/nogit.go +++ b/scan/nogit.go @@ -7,11 +7,11 @@ import ( "path/filepath" "strings" + log "github.com/sirupsen/logrus" + "github.com/zricethezav/gitleaks/v7/config" "github.com/zricethezav/gitleaks/v7/options" - log "github.com/sirupsen/logrus" - "golang.org/x/sync/errgroup" ) @@ -36,7 +36,6 @@ func NewNoGitScanner(opts options.Options, cfg config.Config) *NoGitScanner { log.Error(err) return nil } - return ngs } @@ -95,13 +94,17 @@ func (ngs *NoGitScanner) Scan() (Report, error) { lineNumber++ for _, rule := range ngs.cfg.Rules { line := scanner.Text() + + if rule.AllowList.FileAllowed(filepath.Base(p)) || + rule.AllowList.PathAllowed(p) { + continue + } + offender := rule.Inspect(line) if offender == "" { continue } - if ngs.cfg.Allowlist.RegexAllowed(line) || - rule.AllowList.FileAllowed(filepath.Base(p)) || - rule.AllowList.PathAllowed(p) { + if ngs.cfg.Allowlist.RegexAllowed(line) { continue } diff --git a/scan/scan_test.go b/scan/scan_test.go index 9c47a894..23f7e9db 100644 --- a/scan/scan_test.go +++ b/scan/scan_test.go @@ -15,7 +15,10 @@ import ( const testRepoBase = "../test_data/test_repos/" func TestScan(t *testing.T) { - moveDotGit("dotGit", ".git") + err := moveDotGit("dotGit", ".git") + if err != nil { + t.Fatal(err) + } defer moveDotGit(".git", "dotGit") tests := []struct { description string @@ -32,6 +35,7 @@ func TestScan(t *testing.T) { Path: "../test_data/test_repos/test_repo_1", Report: "../test_data/test_local_repo_one_aws_leak.json.got", ReportFormat: "json", + Threads: runtime.GOMAXPROCS(0), }, wantPath: "../test_data/test_local_repo_one_aws_leak.json", }, @@ -120,6 +124,7 @@ func TestScan(t *testing.T) { Report: "../test_data/test_local_repo_two_leaks_file_commit_range.json.got", ReportFormat: "json", CommitsFile: "../test_data/test_options/test_local_repo_commits.txt", + Threads: runtime.GOMAXPROCS(0), }, wantPath: "../test_data/test_local_repo_two_leaks_file_commit_range.json", }, @@ -219,6 +224,7 @@ func TestScan(t *testing.T) { Report: "../test_data/test_regex_entropy.json.got", ConfigPath: "../test_data/test_configs/regex_entropy.toml", ReportFormat: "json", + Threads: runtime.GOMAXPROCS(0), }, wantPath: "../test_data/test_regex_entropy.json", }, @@ -425,6 +431,38 @@ func TestScan(t *testing.T) { }, wantPath: "../test_data/test_only_files_no_git.json", }, + { + description: "test allowlist files", + opts: options.Options{ + Path: "../test_data/test_repos/test_repo_10", + Report: "../test_data/test_allow_list_file.json.got", + ReportFormat: "json", + ConfigPath: "../test_data/test_configs/allowlist_files.toml", + }, + wantPath: "../test_data/test_allow_list_file.json", + }, + { + description: "test allowlist files no-git", + opts: options.Options{ + Path: "../test_data/test_repos/test_repo_10", + Report: "../test_data/test_allow_list_file_no_git.json.got", + ReportFormat: "json", + ConfigPath: "../test_data/test_configs/allowlist_files.toml", + NoGit: true, + }, + wantPath: "../test_data/test_allow_list_file_no_git.json", + }, + { + description: "test allowlist docx no-git", + opts: options.Options{ + Path: "../test_data/test_repos/test_repo_10", + Report: "../test_data/test_allow_list_docx_no_git.json.got", + ReportFormat: "json", + ConfigPath: "../test_data/test_configs/allowlist_docx.toml", + NoGit: true, + }, + wantPath: "../test_data/test_allow_list_docx_no_git.json", + }, } for _, test := range tests { @@ -708,6 +746,14 @@ func moveDotGit(from, to string) error { return err } for _, dir := range repoDirs { + if to == ".git" { + _, err := os.Stat(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), "dotGit")) + if os.IsNotExist(err) { + // dont want to delete the only copy of .git accidentally + continue + } + os.RemoveAll(fmt.Sprintf("%s/%s/%s", testRepoBase, dir.Name(), ".git")) + } if !dir.IsDir() { continue } @@ -721,6 +767,7 @@ func moveDotGit(from, to string) error { if err != nil { return err } + // fmt.Println("RENAMED") } return nil } diff --git a/test_data/test_allow_list_docx_no_git.json b/test_data/test_allow_list_docx_no_git.json new file mode 100644 index 00000000..e04dfe59 --- /dev/null +++ b/test_data/test_allow_list_docx_no_git.json @@ -0,0 +1,18 @@ +[ + { + "line": "", + "lineNumber": 1, + "offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/bad.zip", + "commit": "", + "repo": "", + "repoURL": "", + "leakURL": "", + "rule": "Block dangerous filetypes", + "commitMessage": "", + "author": "", + "email": "", + "file": "../test_data/test_repos/test_repo_10/bad.zip", + "date": "0001-01-01T00:00:00Z", + "tags": "key, extensions" + } +] diff --git a/test_data/test_allow_list_file.json b/test_data/test_allow_list_file.json new file mode 100644 index 00000000..22abef31 --- /dev/null +++ b/test_data/test_allow_list_file.json @@ -0,0 +1,18 @@ +[ + { + "line": "", + "lineNumber": 1, + "offender": "Filename or path offender: tmp/bad.docx", + "commit": "b0f9b62dfe12e4e10de180359c6b9276472494f8", + "repo": "test_repo_10", + "repoURL": "", + "leakURL": "", + "rule": "Block dangerous filetypes", + "commitMessage": "Create bad.docx", + "author": "Zachary Rice", + "email": "zricer@protonmail.com", + "file": "tmp/bad.docx", + "date": "2020-12-09T11:02:10-05:00", + "tags": "key, extensions" + } +] diff --git a/test_data/test_allow_list_file_no_git.json b/test_data/test_allow_list_file_no_git.json new file mode 100644 index 00000000..200638be --- /dev/null +++ b/test_data/test_allow_list_file_no_git.json @@ -0,0 +1,18 @@ +[ + { + "line": "", + "lineNumber": 1, + "offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/tmp/bad.docx", + "commit": "", + "repo": "", + "repoURL": "", + "leakURL": "", + "rule": "Block dangerous filetypes", + "commitMessage": "", + "author": "", + "email": "", + "file": "../test_data/test_repos/test_repo_10/tmp/bad.docx", + "date": "0001-01-01T00:00:00Z", + "tags": "key, extensions" + } +] diff --git a/test_data/test_configs/allowlist_docx.toml b/test_data/test_configs/allowlist_docx.toml new file mode 100644 index 00000000..6d1e242c --- /dev/null +++ b/test_data/test_configs/allowlist_docx.toml @@ -0,0 +1,11 @@ +[[rules]] + description = "Block dangerous filetypes" + file = '''(.*?)(pdf|doc|docx|zip|xls|tfplan|tfstate|tfvars|vault_pass|vagrant|pyc|key|cache)$''' + tags = ["key", "extensions"] + [rules.allowlist] + paths = ['''.docx'''] + description = "ignore known locations and files" + +#[allowlist] +# description = "Allowlisted files" +# paths = ['''.zip'''] diff --git a/test_data/test_configs/allowlist_files.toml b/test_data/test_configs/allowlist_files.toml new file mode 100644 index 00000000..1bca3275 --- /dev/null +++ b/test_data/test_configs/allowlist_files.toml @@ -0,0 +1,11 @@ +[[rules]] + description = "Block dangerous filetypes" + file = '''(.*?)(pdf|doc|docx|zip|xls|tfplan|tfstate|tfvars|vault_pass|vagrant|pyc|key|cache)$''' + tags = ["key", "extensions"] + [rules.allowlist] + paths = ['''.zip'''] + description = "ignore known locations and files" +# +#[allowlist] +# description = "Allowlisted files" +# paths = ['''.zip'''] diff --git a/test_data/test_only_files_no_git.json b/test_data/test_only_files_no_git.json index 76fb0469..ae4995f9 100644 --- a/test_data/test_only_files_no_git.json +++ b/test_data/test_only_files_no_git.json @@ -2,7 +2,7 @@ { "line": "", "lineNumber": 1, - "offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/no_secrets.md", + "offender": "Filename or path offender: ../test_data/test_repos/test_repo_10/README.md", "commit": "", "repo": "", "repoURL": "", @@ -11,7 +11,7 @@ "commitMessage": "", "author": "", "email": "", - "file": "../test_data/test_repos/test_repo_2/no_secrets.md", + "file": "../test_data/test_repos/test_repo_10/README.md", "date": "0001-01-01T00:00:00Z", "tags": "key, extensions" }, @@ -31,6 +31,22 @@ "date": "0001-01-01T00:00:00Z", "tags": "key, extensions" }, + { + "line": "", + "lineNumber": 1, + "offender": "Filename or path offender: ../test_data/test_repos/test_repo_2/no_secrets.md", + "commit": "", + "repo": "", + "repoURL": "", + "leakURL": "", + "rule": "flag go", + "commitMessage": "", + "author": "", + "email": "", + "file": "../test_data/test_repos/test_repo_2/no_secrets.md", + "date": "0001-01-01T00:00:00Z", + "tags": "key, extensions" + }, { "line": "", "lineNumber": 1, @@ -63,22 +79,6 @@ "date": "0001-01-01T00:00:00Z", "tags": "key, extensions" }, - { - "line": "", - "lineNumber": 1, - "offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/no_secrets.md", - "commit": "", - "repo": "", - "repoURL": "", - "leakURL": "", - "rule": "flag go", - "commitMessage": "", - "author": "", - "email": "", - "file": "../test_data/test_repos/test_repo_4/no_secrets.md", - "date": "0001-01-01T00:00:00Z", - "tags": "key, extensions" - }, { "line": "", "lineNumber": 1, @@ -95,6 +95,22 @@ "date": "0001-01-01T00:00:00Z", "tags": "key, extensions" }, + { + "line": "", + "lineNumber": 1, + "offender": "Filename or path offender: ../test_data/test_repos/test_repo_4/no_secrets.md", + "commit": "", + "repo": "", + "repoURL": "", + "leakURL": "", + "rule": "flag go", + "commitMessage": "", + "author": "", + "email": "", + "file": "../test_data/test_repos/test_repo_4/no_secrets.md", + "date": "0001-01-01T00:00:00Z", + "tags": "key, extensions" + }, { "line": "", "lineNumber": 1, diff --git a/test_data/test_regex_allowlist.json.got b/test_data/test_regex_allowlist.json similarity index 100% rename from test_data/test_regex_allowlist.json.got rename to test_data/test_regex_allowlist.json diff --git a/test_data/test_repos/test_repo_10/.gitleaks.toml b/test_data/test_repos/test_repo_10/.gitleaks.toml new file mode 100644 index 00000000..84f7ae41 --- /dev/null +++ b/test_data/test_repos/test_repo_10/.gitleaks.toml @@ -0,0 +1,11 @@ +[[rules]] + description = "Block dangerous filetypes" + file = '''(.*?)(pdf|doc|docx|zip|xls|tfplan|tfstate|tfvars|vault_pass|vagrant|pyc|key|cache)$''' + tags = ["key", "extensions"] + [rules.allowlist] + paths = ['''.git''', '''.zip'''] + description = "ignore known locations and files" + +[allowlist] + description = "Allowlisted files" + paths = ['''.zip'''] diff --git a/test_data/test_repos/test_repo_10/README.md b/test_data/test_repos/test_repo_10/README.md new file mode 100644 index 00000000..fbf892c7 --- /dev/null +++ b/test_data/test_repos/test_repo_10/README.md @@ -0,0 +1 @@ +# test_repo_paths \ No newline at end of file diff --git a/test_data/test_repos/test_repo_10/bad.zip b/test_data/test_repos/test_repo_10/bad.zip new file mode 100644 index 00000000..7dd4a6d4 --- /dev/null +++ b/test_data/test_repos/test_repo_10/bad.zip @@ -0,0 +1 @@ +this is a bad .zip diff --git a/test_data/test_repos/test_repo_10/dotGit/HEAD b/test_data/test_repos/test_repo_10/dotGit/HEAD new file mode 100644 index 00000000..b870d826 --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/test_data/test_repos/test_repo_10/dotGit/bad.zip b/test_data/test_repos/test_repo_10/dotGit/bad.zip new file mode 100644 index 00000000..e69de29b diff --git a/test_data/test_repos/test_repo_10/dotGit/config b/test_data/test_repos/test_repo_10/dotGit/config new file mode 100644 index 00000000..9a4aba0d --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[remote "origin"] + url = git@github.com:zricethezav/test_repo_paths.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "main"] + remote = origin + merge = refs/heads/main diff --git a/test_data/test_repos/test_repo_10/dotGit/description b/test_data/test_repos/test_repo_10/dotGit/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test_data/test_repos/test_repo_10/dotGit/index b/test_data/test_repos/test_repo_10/dotGit/index new file mode 100644 index 0000000000000000000000000000000000000000..13e4315889689e088a4d0606a711d5d1d9203e93 GIT binary patch literal 397 zcmZ?q402{*U|<4bmiP-_Yqbyjz6PTi85md@_kG;Mz|gpafr0TWP>l$Xjuc#!EOyO5 zHPiQ?L*1%vOAYrFWHvDH>7{3u0L(SWZY952&?;n$n zzd4^#ZPJ~6MD*^RUF9oOv=}&pTpe9}UG;KPAm$vIwi0X(kcOJG56v9m+AGVhq(vIH zU)v`oZ6Plezo=7lJp+4EVv1f>W&zAS$0dBh<^XA^IS0_p;rjBw<^e;n{@dnOn}(eN zHNU4mW6WjXDakF+2bql?9;A9%>0hlds0#rTW)g5{|2V&^~#IlZMT+w;ADwwn<1$D F762delE?r6 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_10/dotGit/info/exclude b/test_data/test_repos/test_repo_10/dotGit/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/test_data/test_repos/test_repo_10/dotGit/logs/HEAD b/test_data/test_repos/test_repo_10/dotGit/logs/HEAD new file mode 100644 index 00000000..e729e639 --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 5cd9652a24771400b4ce76beadbb2496a73341b8 Zach Rice 1607529853 -0500 clone: from github.com:zricethezav/test_repo_paths.git diff --git a/test_data/test_repos/test_repo_10/dotGit/logs/refs/heads/main b/test_data/test_repos/test_repo_10/dotGit/logs/refs/heads/main new file mode 100644 index 00000000..e729e639 --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/logs/refs/heads/main @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 5cd9652a24771400b4ce76beadbb2496a73341b8 Zach Rice 1607529853 -0500 clone: from github.com:zricethezav/test_repo_paths.git diff --git a/test_data/test_repos/test_repo_10/dotGit/logs/refs/remotes/origin/HEAD b/test_data/test_repos/test_repo_10/dotGit/logs/refs/remotes/origin/HEAD new file mode 100644 index 00000000..e729e639 --- /dev/null +++ b/test_data/test_repos/test_repo_10/dotGit/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 5cd9652a24771400b4ce76beadbb2496a73341b8 Zach Rice 1607529853 -0500 clone: from github.com:zricethezav/test_repo_paths.git diff --git a/test_data/test_repos/test_repo_10/dotGit/objects/pack/pack-bb11838b7e60925aeee8a41a4a2b508b576b4b4c.idx b/test_data/test_repos/test_repo_10/dotGit/objects/pack/pack-bb11838b7e60925aeee8a41a4a2b508b576b4b4c.idx new file mode 100644 index 0000000000000000000000000000000000000000..7070ac4863c9266152e56f8137db246767c99763 GIT binary patch literal 1436 zcmexg;-AdGz`z8=xBw$if>;bPhnkofXx?DPEI{{>i`jsB2O6^j-7wTJ2hh#fFegxa zq+>2%7{D+$kd2IafP5I{1+q~vTcy*xH#Nehj8ty5`Y)}nYcz;8XK>oMlr`y(iFkO3CNQuK&!d3fZx!UGgxks+Z?p)?_AU~@s zrsdMbb;~czm7QARi-UBcHB{WW!aUqNaOZv z`=q2TkW{{F-NX+{3syF&MTwz$>2Z^O@Ry8ncpJmh`YU^*vzQklET zlph~o--vzuz(f8-+_9zIlai{~a+5>8{I7Yy5Ul^Uxz(m&r$Ei`sm~a5e;mD^f7;`v zTlTHK9bLL!>Ss*$@A&;=((yOvGpbFxvyX`0y|b%)g^JesS@-&7gO6TXZ5$(X*OPy1 zv|`_3vG+kQZmQZ>JzQ7NnVkIjVrjU*uMbbJX+O>QT7U8O-*RB~4+bVXV425}4-EQD zV3sa{gfr)FAU^_F92x;>F(7sYVxW4?2fGEEyXz7rMZJ5mM9ND$pgTO<+s8ZPh8-YIHf=}3`mr`NTH!B5ETW&8Z}ZxvI1%b$umt+RTWO8 zj&Rxvkix=Dk(w7&QK?Q9m{Vo)Xqp*HO%)>@tGcNd6NwC>WE>nxRuX;(ag|Z<`pqB4 z-#g9(Ya3G4&lzie0R=&9s3yi5c!CCm(j#puAt(p)N_ayGUR%a#SKr@Hl_-bwKeJPJ z>Z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