summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advice.c2
-rw-r--r--advice.h1
-rw-r--r--builtin/am.c6
-rwxr-xr-xt/t4254-am-corrupt.sh2
4 files changed, 5 insertions, 6 deletions
diff --git a/advice.c b/advice.c
index 2aca11f45e..52aa85bdfd 100644
--- a/advice.c
+++ b/advice.c
@@ -17,6 +17,7 @@ int advice_implicit_identity = 1;
int advice_detached_head = 1;
int advice_set_upstream_failure = 1;
int advice_object_name_warning = 1;
+int advice_amworkdir = 1;
int advice_rm_hints = 1;
int advice_add_embedded_repo = 1;
int advice_ignored_hook = 1;
@@ -68,6 +69,7 @@ static struct {
{ "detachedHead", &advice_detached_head },
{ "setupStreamFailure", &advice_set_upstream_failure },
{ "objectNameWarning", &advice_object_name_warning },
+ { "amWorkDir", &advice_amworkdir },
{ "rmHints", &advice_rm_hints },
{ "addEmbeddedRepo", &advice_add_embedded_repo },
{ "ignoredHook", &advice_ignored_hook },
diff --git a/advice.h b/advice.h
index 9f5064e82a..7e9377864f 100644
--- a/advice.h
+++ b/advice.h
@@ -17,6 +17,7 @@ extern int advice_implicit_identity;
extern int advice_detached_head;
extern int advice_set_upstream_failure;
extern int advice_object_name_warning;
+extern int advice_amworkdir;
extern int advice_rm_hints;
extern int advice_add_embedded_repo;
extern int advice_ignored_hook;
diff --git a/builtin/am.c b/builtin/am.c
index d834f9e62b..93130aaa35 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1827,15 +1827,11 @@ static void am_run(struct am_state *state, int resume)
}
if (apply_status) {
- int advice_amworkdir = 1;
-
printf_ln(_("Patch failed at %s %.*s"), msgnum(state),
linelen(state->msg), state->msg);
- git_config_get_bool("advice.amworkdir", &advice_amworkdir);
-
if (advice_amworkdir)
- printf_ln(_("Use 'git am --show-current-patch' to see the failed patch"));
+ advise(_("Use 'git am --show-current-patch' to see the failed patch"));
die_user_resolve(state);
}
diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh
index 168739c721..fd3bdbfe2c 100755
--- a/t/t4254-am-corrupt.sh
+++ b/t/t4254-am-corrupt.sh
@@ -25,7 +25,7 @@ test_expect_success setup '
# fatal: unable to write file '(null)' mode 100644: Bad address
# Also, it had the unwanted side-effect of deleting f.
test_expect_success 'try to apply corrupted patch' '
- test_must_fail git am bad-patch.diff 2>actual
+ test_must_fail git -c advice.amWorkDir=false am bad-patch.diff 2>actual
'
test_expect_success 'compare diagnostic; ensure file is still here' '