Fallback to 'git apply' if available to speed up applying the patches.

This commit is contained in:
Sebastian Lackner 2014-03-05 01:13:32 +01:00
parent 0817bd1a57
commit 556aa9335e

View File

@ -1,6 +1,7 @@
#!/bin/bash
# Setup parser variables
nogit=0
lineno=0
verbose=0
patch_mode=0
@ -60,6 +61,10 @@ while [[ $# > 0 ]]; do
verbose=1
;;
--nogit)
nogit=1
;;
--help)
usage
exit 0
@ -71,6 +76,12 @@ while [[ $# > 0 ]]; do
esac
done
# Redirect to git apply if available
if [ "$nogit" -eq 0 ] && command -v git >/dev/null 2>&1; then
exec git apply "$@"
exit 1
fi
# Decode base85 git data, prepend with a gzip header
awk_b85='
BEGIN{