fix: Add git safe.directory configuration for update commands

- Add 'git config --global --add safe.directory' before git pull in update_instance
- Add same fix to small management script update command
- Resolves 'dubious ownership' error when updating repositories
  that were cloned as root but accessed by different users

This fixes the git ownership security warning that prevents
git pull from working during updates.
This commit is contained in:
Muhammad Ibrahim
2025-09-17 23:41:54 +01:00
parent c8d54facb9
commit fe5fb92e48

View File

@@ -1144,6 +1144,7 @@ case \$1 in
;;
"update")
cd $APP_DIR
git config --global --add safe.directory $APP_DIR 2>/dev/null || true
git pull
npm install
cd backend && npm install
@@ -1364,6 +1365,10 @@ update_instance() {
# Update code
print_info "Pulling latest code..."
# Fix git ownership issue if it exists
git config --global --add safe.directory "$app_dir" 2>/dev/null || true
git pull
# Update dependencies