From f1a5583901e051ef4627bf8be08565c4b331e99a Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Mar 2017 15:13:55 -0400 Subject: 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. --- Utilities/Scripts/update-third-party.bash | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v0.12