]> git.ipfire.org Git - thirdparty/git.git/blobdiff - help.c
entry: check for fstat() errors after checkout
[thirdparty/git.git] / help.c
diff --git a/help.c b/help.c
index a9e451f2ee7a165eecb17746db9cc1a2f7e2cfbb..cf67624a94bc47ad7d373d64a1d3b20f562c8fc1 100644 (file)
--- a/help.c
+++ b/help.c
@@ -34,7 +34,7 @@ static struct category_description main_categories[] = {
        { CAT_foreignscminterface, N_("Interacting with Others") },
        { CAT_plumbingmanipulators, N_("Low-level Commands / Manipulators") },
        { CAT_plumbinginterrogators, N_("Low-level Commands / Interrogators") },
-       { CAT_synchingrepositories, N_("Low-level Commands / Synching Repositories") },
+       { CAT_synchingrepositories, N_("Low-level Commands / Syncing Repositories") },
        { CAT_purehelpers, N_("Low-level Commands / Internal Helpers") },
        { 0, NULL }
 };
@@ -754,19 +754,19 @@ static int append_similar_ref(const char *refname, const struct object_id *oid,
 {
        struct similar_ref_cb *cb = (struct similar_ref_cb *)(cb_data);
        char *branch = strrchr(refname, '/') + 1;
-       const char *remote;
 
        /* A remote branch of the same name is deemed similar */
-       if (skip_prefix(refname, "refs/remotes/", &remote) &&
+       if (starts_with(refname, "refs/remotes/") &&
            !strcmp(branch, cb->base_ref))
-               string_list_append(cb->similar_refs, remote);
+               string_list_append_nodup(cb->similar_refs,
+                                        shorten_unambiguous_ref(refname, 1));
        return 0;
 }
 
 static struct string_list guess_refs(const char *ref)
 {
        struct similar_ref_cb ref_cb;
-       struct string_list similar_refs = STRING_LIST_INIT_NODUP;
+       struct string_list similar_refs = STRING_LIST_INIT_DUP;
 
        ref_cb.base_ref = ref;
        ref_cb.similar_refs = &similar_refs;
@@ -774,7 +774,8 @@ static struct string_list guess_refs(const char *ref)
        return similar_refs;
 }
 
-void help_unknown_ref(const char *ref, const char *cmd, const char *error)
+NORETURN void help_unknown_ref(const char *ref, const char *cmd,
+                              const char *error)
 {
        int i;
        struct string_list suggested_refs = guess_refs(ref);