Skip to content

Commit 7c22364

Browse files
committed
MinGit: use the Git wrapper instead of git-remote-http, if possible
This requires git-for-windows/MINGW-packages#52 to work, and reduces the `.zip` file by about one megabyte (`git-remote-http.exe` weighs two megabytes that compress by about 50% in a `.zip` file). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 449a12d commit 7c22364

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mingit/release.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ sort >"$SCRIPT_PATH"/exclude-list &&
144144
LIST="$(comm -23 "$SCRIPT_PATH"/sorted-all "$SCRIPT_PATH"/exclude-list)" ||
145145
die "Could not copy libexec/git-core/*.exe"
146146

147+
# Use git-wrapper.exe as git-remote-http.exe if supported
148+
if cmp "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http{,s}.exe
149+
then
150+
# verify that the Git wrapper works
151+
cp "/mingw$BITNESS/share/git/git-wrapper.exe" "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http.exe
152+
usage="$($SCRIPT_PATH/root/mingw64/bin/git-remote-http.exe 2>&1)"
153+
case "$?,$usage" in
154+
1,*remote-curl*) ;; # okay, let's use the Git wrapper
155+
*) cp "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-https.exe "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http.exe;;
156+
esac
157+
fi
158+
147159
test ! -f "$TARGET" || rm "$TARGET" || die "Could not remove $TARGET"
148160

149161
echo "Creating .zip archive" &&

0 commit comments

Comments
 (0)