git/fs: move mount point to $repo/.git/fs

Moving the mount point to within the repo
directory means that we can have multiple
git repos mounted at once with no conflict.
This commit is contained in:
Ori Bernstein 2021-05-30 17:46:21 -07:00
parent 1af2546e96
commit 12e952e684
14 changed files with 54 additions and 36 deletions

View file

@ -75,14 +75,17 @@ fn gitup{
gitroot=`{git/conf -r >[2]/dev/null}
if(~ $#gitroot 0)
die 'not a git repository'
gitfs=$gitroot/.git/fs
gitrel=`{pwd | subst '^'$"gitroot'/?'}
if(~ $#gitrel 0)
gitrel='.'
cd $gitroot
startfs=()
if(! test -e /mnt/git/ctl)
if(! test -d $gitfs)
mkdir -p $gitfs
if(! test -e $gitfs/ctl)
startfs=true
if(! grep -s '^repo '$gitroot'$' /mnt/git/ctl >[2]/dev/null)
if(! grep -s '^repo '$gitroot'$' $gitfs/ctl >[2]/dev/null)
startfs=true
if(~ $#startfs 1)
git/fs