From 708970ed14405a496e0651bb7543b5316d6fb3e8 Mon Sep 17 00:00:00 2001 From: Shane Date: Sun, 11 Jan 2026 03:02:09 +0000 Subject: [PATCH] allow for edge case same name repo; set perms anyway --- Makefile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 32c2773..f5c1288 100644 --- a/Makefile +++ b/Makefile @@ -182,8 +182,16 @@ endif @# Auto-append .git if missing $(eval OLD_GIT := $(if $(filter %.git,$(OLD)),$(OLD),$(OLD).git)) $(eval NEW_GIT := $(if $(filter %.git,$(NEW)),$(NEW),$(NEW).git)) - @echo "Moving $(OLD_GIT) to $(NEW_GIT) on $(VPS_HOST)..." - ssh $(VPS) "mkdir -p /srv/git/$$(dirname $(NEW_GIT)) && mv /srv/git/$(OLD_GIT) /srv/git/$(NEW_GIT)" - @echo "Repository moved." - @echo " Don't forget to update your local remote URL:" - @echo " git remote set-url helio-web ssh://$(VPS_USER)@$(VPS_HOST)/srv/git/$(NEW_GIT)" + @if [ "$(OLD_GIT)" != "$(NEW_GIT)" ]; then \ + echo "Moving $(OLD_GIT) to $(NEW_GIT) on $(VPS_HOST)..."; \ + ssh $(VPS) "mkdir -p /srv/git/$$(dirname $(NEW_GIT)) && mv /srv/git/$(OLD_GIT) /srv/git/$(NEW_GIT)"; \ + echo "Repository moved."; \ + else \ + echo "Source and destination are the same. Skipping move."; \ + fi + @echo "Marking directory as safe..." + ssh $(VPS) "git config --global --add safe.directory /srv/git/$(NEW_GIT)" + @if [ "$(OLD_GIT)" != "$(NEW_GIT)" ]; then \ + echo " Don't forget to update your local remote URL:"; \ + fi + echo " git remote set-url helio-web ssh://$(VPS_USER)@$(VPS_HOST)/srv/git/$(NEW_GIT)" -- 2.52.0