@@ -21,11 +21,21 @@ static struct {
21
21
22
22
void advise (const char * advice , ...)
23
23
{
24
+ struct strbuf buf = STRBUF_INIT ;
24
25
va_list params ;
26
+ const char * cp , * np ;
25
27
26
28
va_start (params , advice );
27
- vreportf ( "hint: " , advice , params );
29
+ strbuf_addf ( & buf , advice , params );
28
30
va_end (params );
31
+
32
+ for (cp = buf .buf ; * cp ; cp = np ) {
33
+ np = strchrnul (cp , '\n' );
34
+ fprintf (stderr , _ ("hint: %.*s\n" ), (int )(np - cp ), cp );
35
+ if (* np )
36
+ np ++ ;
37
+ }
38
+ strbuf_release (& buf );
29
39
}
30
40
31
41
int git_default_advice_config (const char * var , const char * value )
@@ -46,16 +56,15 @@ int git_default_advice_config(const char *var, const char *value)
46
56
int error_resolve_conflict (const char * me )
47
57
{
48
58
error ("'%s' is not possible because you have unmerged files." , me );
49
- if (advice_resolve_conflict ) {
59
+ if (advice_resolve_conflict )
50
60
/*
51
61
* Message used both when 'git commit' fails and when
52
62
* other commands doing a merge do.
53
63
*/
54
- advise ("Fix them up in the work tree," );
55
- advise ("and then use 'git add/rm <file>' as" );
56
- advise ("appropriate to mark resolution and make a commit," );
57
- advise ("or use 'git commit -a'." );
58
- }
64
+ advise (_ ("Fix them up in the work tree,\n"
65
+ "and then use 'git add/rm <file>' as\n"
66
+ "appropriate to mark resolution and make a commit,\n"
67
+ "or use 'git commit -a'." ));
59
68
return -1 ;
60
69
}
61
70
0 commit comments