databricks-cli/libs/git
Pieter Noordhuis 7de7583b37
Make fileset take optional list of paths to list (#1684)
## Changes

Before this change, the fileset library would take a single root path
and list all files in it. To support an allowlist of paths to list (much
like a Git `pathspec` without patterns; see [pathspec](pathspec)), this
change introduces an optional argument to `fileset.New` where the caller
can specify paths to list. If not specified, this argument defaults to
list `.` (i.e. list all files in the root).

The motivation for this change is that we wish to expose this pattern in
bundles. Users should be able to specify which paths to synchronize
instead of always only synchronizing the bundle root directory.

[pathspec]:
https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec

## Tests

New and existing unit tests.
2024-08-19 15:15:14 +00:00
..
testdata Never ignore root directory when enumerating files in a repository (#683) 2023-08-21 07:35:02 +00:00
testdata_view_ignore Hardcode `.databricks` ignore pattern to ensure we never sync the cache directory (#295) 2023-04-04 15:44:57 +02:00
clone.go Remove resolution of repo names against the Databricks Github account (#940) 2023-11-01 13:02:06 +00:00
clone_test.go Fall back to full Git clone if shallow clone is not supported (#775) 2023-09-15 09:14:51 +00:00
config.go Update error checks that use the `os` package to use `errors.Is` (#1461) 2024-06-03 12:39:36 +00:00
config_test.go Locate and use global excludes file (#191) 2023-02-02 12:25:53 +01:00
fileset.go Make fileset take optional list of paths to list (#1684) 2024-08-19 15:15:14 +00:00
fileset_test.go Make fileset take optional list of paths to list (#1684) 2024-08-19 15:15:14 +00:00
ignore.go Update error checks that use the `os` package to use `errors.Is` (#1461) 2024-06-03 12:39:36 +00:00
ignore_test.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
reference.go Update error checks that use the `os` package to use `errors.Is` (#1461) 2024-06-03 12:39:36 +00:00
reference_test.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
repository.go Remove user credentials specified in the Git origin URL (#1494) 2024-06-17 09:49:00 +00:00
repository_test.go Remove user credentials specified in the Git origin URL (#1494) 2024-06-17 09:49:00 +00:00
view.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
view_test.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00