Give the user a hint for how to continue in the case that git-am fails because it requires user intervention
Give the user a hint for how to continue in the case that git-am fails because it requires user intervention. Signed-off-by: Robert Shearman <rob@codeweaves.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Robert Shearman committed
May 2, 2006 at 13:32 UTC
ced9456a27197fc038fbc5b5ebad87e55f1920d2
1 file changed
+23
-3
git-am.sh
+23
-3
@@ -14,6 +14,26 @@ stop_here () {
14
exit 1
15
}
16
17
+stop_here_user_resolve () {
18
+ cmdline=$(basename $0)
19
+ if test '' != "$interactive"
20
+ then
21
+ cmdline="$cmdline -i"
22
+ fi
23
+ if test '' != "$threeway"
24
+ then
25
+ cmdline="$cmdline -3"
26
+ fi
27
+ if test '.dotest' != "$dotest"
28
+ then
29
+ cmdline="$cmdline -d=$dotest"
30
+ fi
31
+ echo "When you have resolved this problem run \"$cmdline --resolved\"."
32
+ echo "If you would prefer to skip this patch, instead run \"$cmdline --skip\"."
33
+
34
+ stop_here $1
35
+}
36
+
37
go_next () {
38
rm -f "$dotest/$msgnum" "$dotest/msg" "$dotest/msg-clean" \
39
"$dotest/patch" "$dotest/info"
@@ -374,14 +394,14 @@ do
394
if test '' = "$changed"
395
then
396
echo "No changes - did you forget update-index?"
377
- stop_here $this
397
+ stop_here_user_resolve $this
398
fi
399
unmerged=$(git-ls-files -u)
400
if test -n "$unmerged"
401
then
402
echo "You still have unmerged paths in your index"
403
echo "did you forget update-index?"
384
- stop_here $this
404
+ stop_here_user_resolve $this
405
fi
406
apply_status=0
407
;;
@@ -407,7 +427,7 @@ do
427
if test $apply_status != 0
428
then
429
echo Patch failed at $msgnum.
410
- stop_here $this
430
+ stop_here_user_resolve $this
431
fi
432
433
if test -x "$GIT_DIR"/hooks/pre-applypatch