sourcezap/libexec/srczap/git-rev
2024-05-11 16:43:59 -03:00

21 lines
240 B
Bash

#!/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"