Git doesn't know about untracked files, so we should avoid modifying
them when we adjust permissions in the post-checkout hook. Add an
option to our invocation of git ls-files that controls the use of the
--others flag (which controls listing untracked files), and disable it
when we're looking for files to process with the post-checkout hook.
Since we're about to do a v3.0.0 release, let's bump the version to v3.
Make this change automatically with the following command to avoid any
missed items:
git grep -l github.com/git-lfs/git-lfs/v2 | \
xargs sed -i -e 's!github.com/git-lfs/git-lfs/v2!github.com/git-lfs/git-lfs/v3!g'
When our go.mod file was introduced in commit
114e85c2002091eb415040923d872f8e4a4bc636 in PR #3208, the module
path chosen did not include a trailing /v2 component. However,
the Go modules specification now advises that module paths must
have a "major version suffix" which matches the release version.
We therefore add a /v2 suffix to our module path and all its
instances in import paths.
See also https://golang.org/ref/mod#major-version-suffixes for
details regarding the Go module system's major version suffix rule.
Due to the complexities of handling .gitignores, rely directly on
git-ls-files rather than a custom gitignore-aware directory walking
routine.
As a side-effect, there has been a minor behaviorial change related to
locking. Previously, if a file was locked, then a matching pattern was
added to a .gitignore, that file was no longer considered locked and the
writeable attribute was set on that file. With this change, files which
match a .gitignore, but have been addded to the repository,
will still have their write bit cleared.
Fixes#3797