X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=copy-gitattributes-to-branches.sh;h=dd6c51e93f149c24f56f211518be5477a2fd7e8c;hp=9d51eaee8e453f24325771d0ffe7af6f0386a34e;hb=3f01ab98abbd840499d3aca1c19a97ee8b3ca1e9;hpb=8d2322dbfc4e1e46455e858c3c568d516bde6061 diff --git a/copy-gitattributes-to-branches.sh b/copy-gitattributes-to-branches.sh index 9d51eaee..dd6c51e9 100755 --- a/copy-gitattributes-to-branches.sh +++ b/copy-gitattributes-to-branches.sh @@ -15,14 +15,26 @@ case "$1" in git config core.autocrlf input git reset --hard git for-each-ref 'refs/remotes/origin' | while read -r HASH TYPE REFNAME; do + case "$REFNAME" in + refs/remotes/origin/HEAD) + continue + ;; + esac git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}" git reset --hard "$REFNAME" - cp "${me%/*}/.gitattributes" . + echo "$attr" > ".gitattributes" + find . -type f -exec touch {} \+ git update-index --refresh - git commit -a -m"CRLF" + git add .gitattributes + git commit -a -m"CRLF fixes, .gitattributes file updated" done + git checkout master + true ;; *) + attr=`cat .gitattributes` + export attr ./all each "$me" inner + ./all checkout ;; esac