🐛 Add the safe.directory entry only when missing (#12667)

Every run of manage.sh executes

    git config --global --add safe.directory /home/penpot/penpot

and --add appends unconditionally, so N invocations leave N copies of
the entry in the developer's global git config: after a few months of
daily devenv use, my ~/.config/git/config held 22 duplicates. Ask git
first and add the entry only when it is missing, so the devenv behaves
exactly as before and the host-side global config stops growing.

AI-assisted-by: glm-5.3-flash

Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
This commit is contained in:
Álvaro Tejero-Cantero 2026-11-27 11:33:53 +01:00 committed by GitHub
parent ab9ea2140d
commit a767474773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,8 +82,10 @@ export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD);
export IMAGEMAGICK_VERSION=7.1.2-32
# Safe directory to avoid ownership errors with Git
git config --global --add safe.directory /home/penpot/penpot || true
# Safe directory to avoid ownership errors with Git. --add appends on every
# run, so only add it when missing, or ~/.config/git/config grows a
# duplicate line per invocation.
git config --global --get-all safe.directory | grep -qxF '/home/penpot/penpot' || git config --global --add safe.directory /home/penpot/penpot || true
# Set default java options
export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"};