]> rtime.felk.cvut.cz Git - git.git/blobdiff - advice.c
submodule: Fix documentation of update subcommand
[git.git] / advice.c
index 486f823c78118212080a48e74debd7adae241cda..575bec20b35a31e653e49125386f3dcee880c217 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -61,9 +61,12 @@ void advise(const char *advice, ...)
 
 int git_default_advice_config(const char *var, const char *value)
 {
-       const char *k = skip_prefix(var, "advice.");
+       const char *k;
        int i;
 
+       if (!skip_prefix(var, "advice.", &k))
+               return 0;
+
        for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
                if (strcmp(k, advice_config[i].name))
                        continue;
@@ -76,16 +79,14 @@ int git_default_advice_config(const char *var, const char *value)
 
 int error_resolve_conflict(const char *me)
 {
-       error("'%s' is not possible because you have unmerged files.", me);
+       error("%s is not possible because you have unmerged files.", me);
        if (advice_resolve_conflict)
                /*
                 * Message used both when 'git commit' fails and when
                 * other commands doing a merge do.
                 */
-               advise(_("Fix them up in the work tree,\n"
-                        "and then use 'git add/rm <file>' as\n"
-                        "appropriate to mark resolution and make a commit,\n"
-                        "or use 'git commit -a'."));
+               advise(_("Fix them up in the work tree, and then use 'git add/rm <file>'\n"
+                        "as appropriate to mark resolution and make a commit."));
        return -1;
 }
 
@@ -104,7 +105,7 @@ void detach_advice(const char *new_name)
        "state without impacting any branches by performing another checkout.\n\n"
        "If you want to create a new branch to retain commits you create, you may\n"
        "do so (now or later) by using -b with the checkout command again. Example:\n\n"
-       "  git checkout -b new_branch_name\n\n";
+       "  git checkout -b <new-branch-name>\n\n";
 
        fprintf(stderr, fmt, new_name);
 }