databricks-cli/libs
Pieter Noordhuis a7bf7ba6c5
Reload .gitignore files if they have changed (#190)
This commit changes the code in repository.go to lazily load gitignore
files as opposed to the previous eager approach. This means that the
signature of the `Ignore` function family has changed to return `(bool,
error)`.

This lazy approach fits better when other code is responsible for
recursively walking the file tree, because we never know up front which
gitignore files need to be loaded to compute the ignores. It also means
we no longer have to "prime" the `Repository` instance with a particular
directory we're interested in and rather let calls to `Ignore` load
whatever is needed.

The fileset wrapper under `git/` internally taints all gitignore objects
to force a call to [os.Stat] followed by a reload if they have changed,
before calling into the [fileset.FileSet] functions for recursively
listing files.
2023-01-31 18:34:36 +01:00
..
auth Added `bricks auth login` and `bricks auth token` (#158) 2023-01-06 16:15:57 +01:00
filer Use []byte for files in workspace (#162) 2023-01-05 12:03:31 +01:00
fileset Reload .gitignore files if they have changed (#190) 2023-01-31 18:34:36 +01:00
sync Reload .gitignore files if they have changed (#190) 2023-01-31 18:34:36 +01:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00