mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
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 <jan@janware.com>
This commit is contained in:
parent
77544c701d
commit
016c1f4220
1 changed files with 1 additions and 6 deletions
|
|
@ -180,12 +180,7 @@ clone()
|
||||||
}
|
}
|
||||||
run_git -C $p fetch --prune --recurse-submodules=on-demand $remotename $fromref
|
run_git -C $p fetch --prune --recurse-submodules=on-demand $remotename $fromref
|
||||||
if [ "$toref" ]; then
|
if [ "$toref" ]; then
|
||||||
curref=`git -C $p branch --show-current`
|
run_git -C $p merge --ff-only $remotename/$fromref $toref
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# set -x
|
# set -x
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue