diff options
author | Brad King <brad.king@kitware.com> | 2017-03-24 19:13:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-24 19:13:55 (GMT) |
commit | f1a5583901e051ef4627bf8be08565c4b331e99a (patch) | |
tree | adb4ee981dd36d1bf5d13e9a0267466b7af63f1e /Utilities/Scripts/update-third-party.bash | |
parent | 3142808f15b0dabca8a5d66535c3f795ed470bac (diff) | |
download | CMake-f1a5583901e051ef4627bf8be08565c4b331e99a.zip CMake-f1a5583901e051ef4627bf8be08565c4b331e99a.tar.gz CMake-f1a5583901e051ef4627bf8be08565c4b331e99a.tar.bz2 |
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.
Diffstat (limited to 'Utilities/Scripts/update-third-party.bash')
-rw-r--r-- | Utilities/Scripts/update-third-party.bash | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Utilities/Scripts/update-third-party.bash b/Utilities/Scripts/update-third-party.bash index 3b8358e..670946e 100644 --- a/Utilities/Scripts/update-third-party.bash +++ b/Utilities/Scripts/update-third-party.bash @@ -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 |