mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
update-third-party: Add helper to disable custom gitattributes
Provide a helper function that import scripts can use when the third-party project defines custom Git attributes in its top-level `.gitattributes` file. These must be commented out because Git does not support custom attributes in a subdirectory where we where the third-party project is about to be merged.
This commit is contained in:
@@ -52,6 +52,14 @@ git_archive () {
|
||||
tar -C "$extractdir" -x
|
||||
}
|
||||
|
||||
disable_custom_gitattributes() {
|
||||
pushd "${extractdir}/${name}-reduced"
|
||||
# Git does not allow custom attributes in a subdirectory where we
|
||||
# are about to merge the `.gitattributes` file, so disable them.
|
||||
sed -i '/^\[attr\]/ {s/^/#/}' .gitattributes
|
||||
popd
|
||||
}
|
||||
|
||||
die () {
|
||||
echo >&2 "$@"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user