Skip to content

Commit a145110

Browse files
author
Junio C Hamano
committed
git-am: interactive should fail gracefully.
When feeding patches from standard input, and --interactive is specified, quit, so that the user can re-run the command, instead of infinitely looping. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 221e743 commit a145110

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-am.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ else
172172
echo "$sign" >"$dotest/sign"
173173
echo "$utf8" >"$dotest/utf8"
174174
echo "$keep" >"$dotest/keep"
175-
echo "$threeway" >"$dotest/3way"
176175
echo 1 >"$dotest/next"
177176
fi
178177

@@ -193,7 +192,6 @@ then
193192
else
194193
SIGNOFF=
195194
fi
196-
threeway=$(cat "$dotest/3way")
197195

198196
last=`cat "$dotest/last"`
199197
this=`cat "$dotest/next"`
@@ -256,6 +254,8 @@ do
256254

257255
if test "$interactive" = t
258256
then
257+
test -t 0 ||
258+
die "cannot be interactive without stdin connected to a terminal."
259259
action=again
260260
while test "$action" = again
261261
do

0 commit comments

Comments
 (0)