git-am: ignore --binary option
The git-apply documentation says that --binary is a historical option. This patch lets git-am ignore --binary and removes advertisements of this option. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2946cccfdf
commit
cb3a160d60
@ -10,7 +10,7 @@ SYNOPSIS
|
|||||||
--------
|
--------
|
||||||
[verse]
|
[verse]
|
||||||
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
|
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
|
||||||
[--3way] [--interactive] [--binary]
|
[--3way] [--interactive]
|
||||||
[--whitespace=<option>] [-C<n>] [-p<n>]
|
[--whitespace=<option>] [-C<n>] [-p<n>]
|
||||||
[<mbox> | <Maildir>...]
|
[<mbox> | <Maildir>...]
|
||||||
'git am' (--skip | --resolved | --abort)
|
'git am' (--skip | --resolved | --abort)
|
||||||
@ -59,11 +59,6 @@ default. You could use `--no-utf8` to override this.
|
|||||||
it is supposed to apply to, and we have those blobs
|
it is supposed to apply to, and we have those blobs
|
||||||
available locally.
|
available locally.
|
||||||
|
|
||||||
-b::
|
|
||||||
--binary::
|
|
||||||
Pass `--allow-binary-replacement` flag to 'git-apply'
|
|
||||||
(see linkgit:git-apply[1]).
|
|
||||||
|
|
||||||
--whitespace=<option>::
|
--whitespace=<option>::
|
||||||
This flag is passed to the 'git-apply' (see linkgit:git-apply[1])
|
This flag is passed to the 'git-apply' (see linkgit:git-apply[1])
|
||||||
program that applies
|
program that applies
|
||||||
|
19
git-am.sh
19
git-am.sh
@ -10,7 +10,7 @@ git am [options] (--resolved | --skip | --abort)
|
|||||||
--
|
--
|
||||||
d,dotest= (removed -- do not use)
|
d,dotest= (removed -- do not use)
|
||||||
i,interactive run interactively
|
i,interactive run interactively
|
||||||
b,binary pass --allow-binary-replacement to git-apply
|
b,binary (historical option -- no-op)
|
||||||
3,3way allow fall back on 3way merging if needed
|
3,3way allow fall back on 3way merging if needed
|
||||||
s,signoff add a Signed-off-by line to the commit message
|
s,signoff add a Signed-off-by line to the commit message
|
||||||
u,utf8 recode into utf8 (default)
|
u,utf8 recode into utf8 (default)
|
||||||
@ -87,7 +87,7 @@ fall_back_3way () {
|
|||||||
|
|
||||||
echo Using index info to reconstruct a base tree...
|
echo Using index info to reconstruct a base tree...
|
||||||
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
|
||||||
git apply $binary --cached <"$dotest/patch"
|
git apply --cached <"$dotest/patch"
|
||||||
then
|
then
|
||||||
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
|
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
|
||||||
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
|
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
|
||||||
@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
|
|||||||
|
|
||||||
prec=4
|
prec=4
|
||||||
dotest="$GIT_DIR/rebase-apply"
|
dotest="$GIT_DIR/rebase-apply"
|
||||||
sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
|
sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
|
||||||
resolvemsg= resume=
|
resolvemsg= resume=
|
||||||
git_apply_opt=
|
git_apply_opt=
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ do
|
|||||||
-i|--interactive)
|
-i|--interactive)
|
||||||
interactive=t ;;
|
interactive=t ;;
|
||||||
-b|--binary)
|
-b|--binary)
|
||||||
binary=t ;;
|
: ;;
|
||||||
-3|--3way)
|
-3|--3way)
|
||||||
threeway=t ;;
|
threeway=t ;;
|
||||||
-s|--signoff)
|
-s|--signoff)
|
||||||
@ -149,7 +149,7 @@ do
|
|||||||
--abort)
|
--abort)
|
||||||
abort=t ;;
|
abort=t ;;
|
||||||
--rebasing)
|
--rebasing)
|
||||||
rebasing=t threeway=t keep=t binary=t ;;
|
rebasing=t threeway=t keep=t ;;
|
||||||
-d|--dotest)
|
-d|--dotest)
|
||||||
die "-d option is no longer supported. Do not use."
|
die "-d option is no longer supported. Do not use."
|
||||||
;;
|
;;
|
||||||
@ -247,10 +247,9 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# -b, -s, -u, -k and --whitespace flags are kept for the
|
# -s, -u, -k and --whitespace flags are kept for the
|
||||||
# resuming session after a patch failure.
|
# resuming session after a patch failure.
|
||||||
# -3 and -i can and must be given when resuming.
|
# -3 and -i can and must be given when resuming.
|
||||||
echo "$binary" >"$dotest/binary"
|
|
||||||
echo " $ws" >"$dotest/whitespace"
|
echo " $ws" >"$dotest/whitespace"
|
||||||
echo "$sign" >"$dotest/sign"
|
echo "$sign" >"$dotest/sign"
|
||||||
echo "$utf8" >"$dotest/utf8"
|
echo "$utf8" >"$dotest/utf8"
|
||||||
@ -274,10 +273,6 @@ case "$resolved" in
|
|||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test "$(cat "$dotest/binary")" = t
|
|
||||||
then
|
|
||||||
binary=--allow-binary-replacement
|
|
||||||
fi
|
|
||||||
if test "$(cat "$dotest/utf8")" = t
|
if test "$(cat "$dotest/utf8")" = t
|
||||||
then
|
then
|
||||||
utf8=-u
|
utf8=-u
|
||||||
@ -459,7 +454,7 @@ do
|
|||||||
|
|
||||||
case "$resolved" in
|
case "$resolved" in
|
||||||
'')
|
'')
|
||||||
git apply $git_apply_opt $binary --index "$dotest/patch"
|
git apply $git_apply_opt --index "$dotest/patch"
|
||||||
apply_status=$?
|
apply_status=$?
|
||||||
;;
|
;;
|
||||||
t)
|
t)
|
||||||
|
@ -36,7 +36,7 @@ test_expect_success 'setup' '
|
|||||||
|
|
||||||
test_expect_success 'am' '
|
test_expect_success 'am' '
|
||||||
|
|
||||||
git am --binary -3 <patchfile &&
|
git am -3 <patchfile &&
|
||||||
git diff-files --name-status --exit-code
|
git diff-files --name-status --exit-code
|
||||||
|
|
||||||
'
|
'
|
||||||
|
Loading…
Reference in New Issue
Block a user