Merge branch 'jn/warn-on-inaccessible-loosen'
[gitweb.git] / advice.c
index a492eea24f71ad2d2082efce9d1d925a5766b111..d2879272802cb3477dd6b47a78098ffdc26dcb37 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -1,9 +1,10 @@
 #include "cache.h"
 
-int advice_push_nonfastforward = 1;
+int advice_push_update_rejected = 1;
 int advice_push_non_ff_current = 1;
 int advice_push_non_ff_default = 1;
 int advice_push_non_ff_matching = 1;
+int advice_push_already_exists = 1;
 int advice_status_hints = 1;
 int advice_commit_before_merge = 1;
 int advice_resolve_conflict = 1;
@@ -14,15 +15,19 @@ static struct {
        const char *name;
        int *preference;
 } advice_config[] = {
-       { "pushnonfastforward", &advice_push_nonfastforward },
+       { "pushupdaterejected", &advice_push_update_rejected },
        { "pushnonffcurrent", &advice_push_non_ff_current },
        { "pushnonffdefault", &advice_push_non_ff_default },
        { "pushnonffmatching", &advice_push_non_ff_matching },
+       { "pushalreadyexists", &advice_push_already_exists },
        { "statushints", &advice_status_hints },
        { "commitbeforemerge", &advice_commit_before_merge },
        { "resolveconflict", &advice_resolve_conflict },
        { "implicitidentity", &advice_implicit_identity },
        { "detachedhead", &advice_detached_head },
+
+       /* make this an alias for backward compatibility */
+       { "pushnonfastforward", &advice_push_update_rejected }
 };
 
 void advise(const char *advice, ...)
@@ -32,7 +37,7 @@ void advise(const char *advice, ...)
        const char *cp, *np;
 
        va_start(params, advice);
-       strbuf_addf(&buf, advice, params);
+       strbuf_vaddf(&buf, advice, params);
        va_end(params);
 
        for (cp = buf.buf; *cp; cp = np) {