X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/c9f5c2cb085b3cee31b9a85bbe9394d3b0942ee5..57a63d4062e8853488d218b84e56dc6d8060678d:/lib/gitless diff --git a/lib/gitless b/lib/gitless index 8781316..e686e58 100644 --- a/lib/gitless +++ b/lib/gitless @@ -21,7 +21,6 @@ # commands can be used, as long as the file server is available. lib = - gitless_checkout() { server="$1" remotebase="$2" @@ -29,13 +28,18 @@ lib = hostname="$(hostname)" if [ "$hostname" = "$server" ]; then git clone "$dir.git" "$dir" + cd "$dir" else if [ ! -d "$remotebase/$dir.$hostname" ]; then git clone --no-checkout "$remotebase/$dir.git" "$remotebase/$dir.$hostname" fi - mkdir -p $dir - cd $dir - ln -sf $remotebase/$dir/.git - git checkout . + mkdir -p "$dir" + cd "$dir" + ln -sf "$remotebase/$dir.$hostname/.git" + git reset --hard fi + + # disable auto gc, because it breaks repo hard links, + # and is not smart to run over a networked filesystem + git config gc.auto 0 }