diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2021-08-03 17:44:26 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2021-08-03 17:44:26 +0300 |
commit | 00587e6348fbd209f9f53bfb34e7429b35fe5a0a (patch) | |
tree | 54db3d83697c8532add119e70321f3a274968e0d | |
parent | 34b334ce1ce1a3e99e57980a388d9721b05faaf7 (diff) |
Ignore the path argument to repoFiler's ReadDir
ReadDir always returns the full listing of all files in the repository
and filters out any directories from the return values. As such, we can
simplify the function slightly to ignore the path argument completely.
-rw-r--r-- | internal/gitaly/service/repository/license.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/internal/gitaly/service/repository/license.go b/internal/gitaly/service/repository/license.go index 3493556fc..ee5f19d13 100644 --- a/internal/gitaly/service/repository/license.go +++ b/internal/gitaly/service/repository/license.go @@ -111,12 +111,7 @@ func (f *gitFiler) ReadFile(path string) ([]byte, error) { return stdout.Bytes(), nil } -func (f *gitFiler) ReadDir(path string) ([]filer.File, error) { - dotPath := path - if dotPath == "" { - dotPath = "." - } - +func (f *gitFiler) ReadDir(string) ([]filer.File, error) { // We're doing a recursive listing returning all files at once such that we do not have to // call git-ls-tree(1) multiple times. var stderr bytes.Buffer @@ -127,7 +122,7 @@ func (f *gitFiler) ReadDir(path string) ([]filer.File, error) { git.Flag{Name: "-z"}, git.Flag{Name: "-r"}, }, - Args: []string{"HEAD", dotPath}, + Args: []string{"HEAD"}, }, git.WithStderr(&stderr)) if err != nil { return nil, err |