@matheusbsbs / matheus-bagliano / commits / cb3a160d60
Fork 0

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>

Stephan Beyer committed Aug 9, 2008 at 01:28 UTC cb3a160d604866331fdb0f5078face4ab2a4b49a
3 files changed +9 -19
Documentation/git-am.txt
+1 -6
@@ -10,7 +10,7 @@ SYNOPSIS
10 --------
11 [verse]
12 'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
13 - [--3way] [--interactive] [--binary]
13 + [--3way] [--interactive]
14 [--whitespace=<option>] [-C<n>] [-p<n>]
15 [<mbox> | <Maildir>...]
16 'git am' (--skip | --resolved | --abort)
@@ -59,11 +59,6 @@ default. You could use `--no-utf8` to override this.
59 it is supposed to apply to, and we have those blobs
60 available locally.
61
62 --b::
63 ---binary::
64 - Pass `--allow-binary-replacement` flag to 'git-apply'
65 - (see linkgit:git-apply[1]).
66 -
62 --whitespace=<option>::
63 This flag is passed to the 'git-apply' (see linkgit:git-apply[1])
64 program that applies
git-am.sh
+7 -12
@@ -10,7 +10,7 @@ git am [options] (--resolved | --skip | --abort)
10 --
11 d,dotest= (removed -- do not use)
12 i,interactive run interactively
13 -b,binary pass --allow-binary-replacement to git-apply
13 +b,binary (historical option -- no-op)
14 3,3way allow fall back on 3way merging if needed
15 s,signoff add a Signed-off-by line to the commit message
16 u,utf8 recode into utf8 (default)
@@ -87,7 +87,7 @@ fall_back_3way () {
87
88 echo Using index info to reconstruct a base tree...
89 if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
90 - git apply $binary --cached <"$dotest/patch"
90 + git apply --cached <"$dotest/patch"
91 then
92 mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
93 mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index."
121
122 prec=4
123 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=
125 resolvemsg= resume=
126 git_apply_opt=
127
@@ -131,7 +131,7 @@ do
131 -i|--interactive)
132 interactive=t ;;
133 -b|--binary)
134 - binary=t ;;
134 + : ;;
135 -3|--3way)
136 threeway=t ;;
137 -s|--signoff)
@@ -149,7 +149,7 @@ do
149 --abort)
150 abort=t ;;
151 --rebasing)
152 - rebasing=t threeway=t keep=t binary=t ;;
152 + rebasing=t threeway=t keep=t ;;
153 -d|--dotest)
154 die "-d option is no longer supported. Do not use."
155 ;;
@@ -247,10 +247,9 @@ else
247 exit 1
248 }
249
250 - # -b, -s, -u, -k and --whitespace flags are kept for the
250 + # -s, -u, -k and --whitespace flags are kept for the
251 # resuming session after a patch failure.
252 # -3 and -i can and must be given when resuming.
253 - echo "$binary" >"$dotest/binary"
253 echo " $ws" >"$dotest/whitespace"
254 echo "$sign" >"$dotest/sign"
255 echo "$utf8" >"$dotest/utf8"
@@ -274,10 +273,6 @@ case "$resolved" in
273 fi
274 esac
275
277 -if test "$(cat "$dotest/binary")" = t
278 -then
279 - binary=--allow-binary-replacement
280 -fi
276 if test "$(cat "$dotest/utf8")" = t
277 then
278 utf8=-u
@@ -459,7 +454,7 @@ do
454
455 case "$resolved" in
456 '')
462 - git apply $git_apply_opt $binary --index "$dotest/patch"
457 + git apply $git_apply_opt --index "$dotest/patch"
458 apply_status=$?
459 ;;
460 t)
t/t0023-crlf-am.sh
+1 -1
@@ -36,7 +36,7 @@ test_expect_success 'setup' '
36
37 test_expect_success 'am' '
38
39 - git am --binary -3 <patchfile &&
39 + git am -3 <patchfile &&
40 git diff-files --name-status --exit-code
41
42 '