X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=copy-gitattributes-to-branches.sh;h=cdb50ba6d50b308d99caa98d62a30a4215a29abe;hp=2ffb44fc492c11a519ddd02b28602d0b513b632c;hb=c9bc849a1eb42320042d0dea931c4dcc9859b9a0;hpb=ee731ded7d825fc801fb5e539dfc8f67383375cf;ds=sidebyside diff --git a/copy-gitattributes-to-branches.sh b/copy-gitattributes-to-branches.sh index 2ffb44fc..cdb50ba6 100755 --- a/copy-gitattributes-to-branches.sh +++ b/copy-gitattributes-to-branches.sh @@ -15,12 +15,18 @@ 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" echo "$attr" > "${me%/*}/.gitattributes" git update-index --refresh - git commit -a -m"CRLF" + git commit -a -m"CRLF fixes, .gitattributes file updated" done + true ;; *) attr=`cat .gitattributes`