From e2bd6538ae96e7c13de8ee89a623c672d9cdbcb7 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Tue, 13 Jan 2026 16:50:37 -0500 Subject: [PATCH] fix two bugs with push/clean exiting cowardly --- Makefile | 15 +++++++++++++++ TODO.rst | 4 +++- git-remote-gcrypt | 28 ++++++++++++++++++--------- tests/test_rsync_simple.sh | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 tests/test_rsync_simple.sh diff --git a/Makefile b/Makefile index 8d2a012..8ddfcc7 100644 --- a/Makefile +++ b/Makefile @@ -212,6 +212,21 @@ uninstall/user: ##H make uninstall prefix=~/.local + +.PHONY: deploy/debian +deploy/debian: ##H Build Debian package + @$(call print_target,deploy/debian) + @$(call print_info,Building Debian package...) + gbp buildpackage -uc -us + @$(call print_success,Built Debian package.) + +.PHONY: deploy/redhat +deploy/redhat: ##H Build RPM package + @$(call print_target,deploy/redhat) + @$(call print_info,Building RPM package...) + rpmbuild -bb redhat/git-remote-gcrypt.spec + @$(call print_success,Built RPM package.) + .PHONY: clean clean: ##H Clean up rm -rf .coverage .build_tmp diff --git a/TODO.rst b/TODO.rst index f22980e..d1afd10 100644 --- a/TODO.rst +++ b/TODO.rst @@ -1,7 +1,9 @@ Saturday, 1/10/26 -Q: Does the manifest +Q: Does the manifest... (contain? ) + +~~~~~~~~~~~~~~~~~~~~~~ The issue here is the second one is a valid, encrypted remote. The tool is doing too much work and providing dumb results, at times, by trying to be fancy and smart. diff --git a/git-remote-gcrypt b/git-remote-gcrypt index be58d0c..951d7c2 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -520,8 +520,15 @@ REMOVE() print_debug "Calling rsync..." ( if [ -n "${GCRYPT_TRACE:-}" ]; then set -x; fi + # rsync needs parent directories included or it won't traverse them + echo "$2" | while IFS= read -r f; do + d=$(dirname "$f") + mkdir -p "$Localdir/$d" + done + # rsync needs stdin for --include-from=- - rsync -I -W -v -r --delete --include-from=- \ + # We include specific files ($2), then include ALL directories (*/), then exclude everything else (*). + rsync -I -W -v -r --delete --include-from=- --include='*/' \ --exclude='*' "$Localdir"/ "$(rsynclocation "$1")/" >&2 ) <