From 016c1f4220140394b08efbd1037c0d074b9fbd90 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 29 Nov 2025 15:35:25 +0100 Subject: [PATCH] pgit.sh: Don't fetch with target refspec "git fetch $remote $fromref:$toref" fails if the $fromref is behind $toref. Unrolling the syntax into "git fetch" followed by "git merge --ff-only $remote/$fromref $toref" is accepted, though, and saves some otherwise necessary case distinction code around it. Signed-off-by: Jan Lindemann --- scripts/pgit.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/pgit.sh b/scripts/pgit.sh index 183559f4..14c5cb51 100644 --- a/scripts/pgit.sh +++ b/scripts/pgit.sh @@ -180,12 +180,7 @@ clone() } run_git -C $p fetch --prune --recurse-submodules=on-demand $remotename $fromref if [ "$toref" ]; then - curref=`git -C $p branch --show-current` - if [ "$curref" = "$toref" ]; then - run_git -C $p pull --recurse-submodules=on-demand $remotename $fromref - else - run_git -C $p fetch --recurse-submodules=on-demand $remotename $fromref:$toref - fi + run_git -C $p merge --ff-only $remotename/$fromref $toref fi else # set -x