-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attr: attr.allowInvalidSource config to allow invalid revision
44451a2 (attr: teach "--attr-source=<tree>" global option to "git", 2023-05-06) provided the ability to pass in a treeish as the attr source. When a revision does not resolve to a valid tree is passed, Git will die. GitLab keeps bare repositories and always reads attributes from the default branch, so we pass in HEAD to --attr-source. With empty repositories however, HEAD does not point to a valid treeish, causing Git to die. This means we would need to check for a valid treeish each time. To avoid this, let's add a configuration that allows Git to simply ignore --attr-source if it does not resolve to a valid tree.
- Loading branch information
Showing
4 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
attr.allowInvalidSource:: | ||
If `--attr-source` cannot resolve to a valid tree object, ignore | ||
`--attr-source` instead of erroring out, and fall back to looking for | ||
attributes in the default locations. Useful when passing `HEAD` into | ||
`attr-source` since it allows `HEAD` to point to an unborn branch in | ||
cases like an empty repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters