Skip to content

Commit 2291a23

Browse files
committed
git-synchronizer: Special-case SourceForge
SourceForge has enabled the receive.denyNonFastForwards option without a way to disable it. Therefore, let's work around that by deleting non-fast-forwarding branches first, before pushing them again. This fixes #2. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent da2772a commit 2291a23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

git-synchronizer.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ do
257257
fi
258258
done)
259259
test -z "$pushopts" && continue
260+
deletefirst=
260261
case "$(git config "remote.$name.pushurl"; git config "remote.$name.url")" in
261262
git://*)
262263
case "$pushopts" in
@@ -266,7 +267,16 @@ do
266267
esac
267268
continue
268269
;;
270+
*.sf.net*|*.sourceforge.net*)
271+
for opt in $pushopts
272+
do
273+
test "$opt" = "${opt#+*:}" ||
274+
deletefirst="$deletefirst :${opt#+*:}"
275+
done
269276
esac
277+
test -z "$deletefirst" ||
278+
git push $name $deletefirst ||
279+
add_error "Could not push $deletefirst to $url"
270280
git push $name $pushopts ||
271281
add_error "Could not push to $url"
272282
done

0 commit comments

Comments
 (0)