Modification : vm_{host,hosted,remote} -> {host,local,remote}/ .
[lhc/ateliers.git] / local / git-configure
diff --git a/local/git-configure b/local/git-configure
new file mode 100755 (executable)
index 0000000..e7ff6c1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh -eu
+tool=$(readlink -e "${0%/*}/..")
+. "$tool"/local/lib.sh
+
+cd "$tool"
+git config --replace branch.master.remote .
+git config --replace branch.master.merge refs/remotes/master
+install -m 770 /dev/stdin \
+ .git/hooks/post-update <<-EOF
+       #!/bin/sh -efux
+       case \$1 in
+        (refs/remotes/master)
+               cd ..
+               git --git-dir=\$PWD/.git checkout -f -B master remotes/master
+               git --git-dir=\$PWD/.git clean -f -d -x
+               ;;
+        esac
+       EOF