Skip to content

Commit cb3a160

Browse files
sbeyergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2946ccc commit cb3a160

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

Documentation/git-am.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
13-
[--3way] [--interactive] [--binary]
13+
[--3way] [--interactive]
1414
[--whitespace=<option>] [-C<n>] [-p<n>]
1515
[<mbox> | <Maildir>...]
1616
'git am' (--skip | --resolved | --abort)
@@ -59,11 +59,6 @@ default. You could use `--no-utf8` to override this.
5959
it is supposed to apply to, and we have those blobs
6060
available locally.
6161

62-
-b::
63-
--binary::
64-
Pass `--allow-binary-replacement` flag to 'git-apply'
65-
(see linkgit:git-apply[1]).
66-
6762
--whitespace=<option>::
6863
This flag is passed to the 'git-apply' (see linkgit:git-apply[1])
6964
program that applies

git-am.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ git am [options] (--resolved | --skip | --abort)
1010
--
1111
d,dotest= (removed -- do not use)
1212
i,interactive run interactively
13-
b,binary pass --allow-binary-replacement to git-apply
13+
b,binary (historical option -- no-op)
1414
3,3way allow fall back on 3way merging if needed
1515
s,signoff add a Signed-off-by line to the commit message
1616
u,utf8 recode into utf8 (default)
@@ -87,7 +87,7 @@ fall_back_3way () {
8787

8888
echo Using index info to reconstruct a base tree...
8989
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
90-
git apply $binary --cached <"$dotest/patch"
90+
git apply --cached <"$dotest/patch"
9191
then
9292
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
9393
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
121121

122122
prec=4
123123
dotest="$GIT_DIR/rebase-apply"
124-
sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=
124+
sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
125125
resolvemsg= resume=
126126
git_apply_opt=
127127

@@ -131,7 +131,7 @@ do
131131
-i|--interactive)
132132
interactive=t ;;
133133
-b|--binary)
134-
binary=t ;;
134+
: ;;
135135
-3|--3way)
136136
threeway=t ;;
137137
-s|--signoff)
@@ -149,7 +149,7 @@ do
149149
--abort)
150150
abort=t ;;
151151
--rebasing)
152-
rebasing=t threeway=t keep=t binary=t ;;
152+
rebasing=t threeway=t keep=t ;;
153153
-d|--dotest)
154154
die "-d option is no longer supported. Do not use."
155155
;;
@@ -247,10 +247,9 @@ else
247247
exit 1
248248
}
249249

250-
# -b, -s, -u, -k and --whitespace flags are kept for the
250+
# -s, -u, -k and --whitespace flags are kept for the
251251
# resuming session after a patch failure.
252252
# -3 and -i can and must be given when resuming.
253-
echo "$binary" >"$dotest/binary"
254253
echo " $ws" >"$dotest/whitespace"
255254
echo "$sign" >"$dotest/sign"
256255
echo "$utf8" >"$dotest/utf8"
@@ -274,10 +273,6 @@ case "$resolved" in
274273
fi
275274
esac
276275

277-
if test "$(cat "$dotest/binary")" = t
278-
then
279-
binary=--allow-binary-replacement
280-
fi
281276
if test "$(cat "$dotest/utf8")" = t
282277
then
283278
utf8=-u
@@ -459,7 +454,7 @@ do
459454

460455
case "$resolved" in
461456
'')
462-
git apply $git_apply_opt $binary --index "$dotest/patch"
457+
git apply $git_apply_opt --index "$dotest/patch"
463458
apply_status=$?
464459
;;
465460
t)

t/t0023-crlf-am.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success 'setup' '
3636

3737
test_expect_success 'am' '
3838
39-
git am --binary -3 <patchfile &&
39+
git am -3 <patchfile &&
4040
git diff-files --name-status --exit-code
4141
4242
'

0 commit comments

Comments
 (0)