Fix git safe.directory error for non-root users after install
Unit Tests / test (push) Successful in 8m55s

The installer runs as root and chowns /opt/pic to the pic user.
Any other user (roof, operator) running make update then hits
"detected dubious ownership". Fix: add /opt/pic to system-wide
git safe.directory after clone, and add same guard in make update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 05:46:40 -04:00
parent 1e2cf5580f
commit bfa0d99dd1
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -131,6 +131,7 @@ shell-%:
update: update:
@echo "Pulling latest code..." @echo "Pulling latest code..."
@git config --global --add safe.directory $$(pwd) 2>/dev/null || true
@git stash --include-untracked --quiet 2>/dev/null || true @git stash --include-untracked --quiet 2>/dev/null || true
git pull git pull
@git stash pop --quiet 2>/dev/null || true @git stash pop --quiet 2>/dev/null || true
+3
View File
@@ -247,6 +247,9 @@ fi
# Ensure the pic user owns the directory # Ensure the pic user owns the directory
chown -R "${PIC_USER}:${PIC_USER}" "$PIC_DIR" chown -R "${PIC_USER}:${PIC_USER}" "$PIC_DIR"
# Allow any user to run git commands in this directory (installer runs as root,
# operators run as themselves — git safe.directory prevents ownership errors)
git config --system --add safe.directory "$PIC_DIR" 2>/dev/null || true
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Step 5 — Run make install # Step 5 — Run make install