git-am: --whitespace=x option.
This is passed down to git-apply to override the built-in default and per-repository configuration at runtime. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 28, 2006 at 20:26 UTC
12cbbdc40b50458b29b76af740ddc0ab1979b322
1 file changed
+9
-4
git-am.sh
+9
-4
@@ -100,7 +100,7 @@ fall_back_3way () {
100
}
101
102
prec=4
103
-dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary=
103
+dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws=
104
105
while case "$#" in 0) break;; esac
106
do
@@ -133,6 +133,9 @@ do
133
--sk|--ski|--skip)
134
skip=t; shift ;;
135
136
+ --whitespace=*)
137
+ ws=$1; shift ;;
138
+
139
--)
140
shift; break ;;
141
-*)
@@ -171,10 +174,11 @@ else
174
exit 1
175
}
176
174
- # -b, -s, -u and -k flags are kept for the resuming session after
175
- # a patch failure.
177
+ # -b, -s, -u, -k and --whitespace flags are kept for the
178
+ # resuming session after a patch failure.
179
# -3 and -i can and must be given when resuming.
180
echo "$binary" >"$dotest/binary"
181
+ echo " $ws" >"$dotest/whitespace"
182
echo "$sign" >"$dotest/sign"
183
echo "$utf8" >"$dotest/utf8"
184
echo "$keep" >"$dotest/keep"
@@ -202,6 +206,7 @@ if test "$(cat "$dotest/keep")" = t
206
then
207
keep=-k
208
fi
209
+ws=`cat "$dotest/whitespace"`
210
if test "$(cat "$dotest/sign")" = t
211
then
212
SIGNOFF=`git-var GIT_COMMITTER_IDENT | sed -e '
@@ -355,7 +360,7 @@ do
360
361
case "$resolved" in
362
'')
358
- git-apply $binary --index "$dotest/patch"
363
+ git-apply $binary --index $ws "$dotest/patch"
364
apply_status=$?
365
;;
366
t)