portzap/libexec/portzap/git-rev
0x1eef 4aaa685b3d Switch branch in 'portzap pull'
This commit covers a few changes:

* The 'portzap pull' command now switches to '$PORTZAP_BRANCH'
  if 'git branch --show-current' returns a different branch.

* The 'portzap pull' command fixes permissions and ownership on
  '/home/_portzap/ports/.git' before running any git commands. The
  owner and permissions can change by interacting with the
  git repository directly, as a user other than '_portzap'.

* doas.conf has been changed to be slightly more strict
2024-04-19 04:15:12 -03:00

11 lines
129 B
Bash

#!/bin/sh -e
##
# variables
git=/usr/local/bin/git
gitdir=$1
##
# main
cd "${gitdir}"
doas -u _portzap "${git}" rev-parse HEAD