From bfa0d99dd120138e765b53d3fa943dc6b8e0bce9 Mon Sep 17 00:00:00 2001 From: Dmitrii Iurco Date: Mon, 11 May 2026 05:46:40 -0400 Subject: [PATCH] Fix git safe.directory error for non-root users after install 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 --- Makefile | 1 + install.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 9e99ea1..46fbcea 100644 --- a/Makefile +++ b/Makefile @@ -131,6 +131,7 @@ shell-%: update: @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 pull @git stash pop --quiet 2>/dev/null || true diff --git a/install.sh b/install.sh index c3590c4..a1f1c0a 100755 --- a/install.sh +++ b/install.sh @@ -247,6 +247,9 @@ fi # Ensure the pic user owns the directory 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