sourcezap/libexec/srczap/git-rev

22 lines
240 B
Text
Raw Normal View History

2024-05-11 21:43:59 +02:00
#!/bin/sh
set -e
##
# variables
git=/usr/local/bin/git
gitdir=$1
mode=u=rwX,g=rX,o=
##
# functions
gitexec()
{
doas -n -u _srczap \
/bin/sh -c "umask ${mode}; ${git} ${1}"
}
##
# main
cd "${gitdir}"
gitexec "rev-parse HEAD"