]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - copy-gitattributes-to-branches.sh
fix another typo
[xonotic/xonotic.git] / copy-gitattributes-to-branches.sh
index 2ffb44fc492c11a519ddd02b28602d0b513b632c..1b4ad07522f8e6dff21b92fc2928c996264fd55c 100755 (executable)
@@ -15,12 +15,20 @@ 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
                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"
                        git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}"
                        git reset --hard "$REFNAME"
-                       echo "$attr" > "${me%/*}/.gitattributes"
+                       echo "$attr" > ".gitattributes"
                        git update-index --refresh
                        git update-index --refresh
-                       git commit -a -m"CRLF"
+                       git add .gitattributes
+                       git commit -a -m"CRLF fixes, .gitattributes file updated"
                done
                done
+               git checkout master
+               true
                ;;
        *)
                attr=`cat .gitattributes`
                ;;
        *)
                attr=`cat .gitattributes`