]> git.xonotic.org Git - xonotic/xonotic.git/blob - copy-gitattributes-to-branches.sh
more fixing
[xonotic/xonotic.git] / copy-gitattributes-to-branches.sh
1 #!/bin/sh
2
3 case "$0" in
4         /*)
5                 me=$0
6                 ;;
7         *)
8                 me="$PWD/$0"
9                 ;;
10 esac
11 export me
12
13 case "$1" in
14         inner)
15                 git config core.autocrlf input
16                 git reset --hard
17                 git for-each-ref 'refs/remotes/origin' | while read -r HASH TYPE REFNAME; do
18                         git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}"
19                         git reset --hard "$REFNAME"
20                         echo "$attr" > "${me%/*}/.gitattributes"
21                         git update-index --refresh
22                         git commit -a -m"CRLF"
23                 done
24                 ;;
25         *)
26                 attr=`cat .gitattributes`
27                 export attr
28                 ./all each "$me" inner
29                 ./all checkout
30                 ;;
31 esac