sequencer: lib'ify checkout_fast_forward()
[gitweb.git] / builtin / remote.c
index c4b4d674bd139eac863253fe8c1f2d7441496447..9f6a6b3a9cea036d9a58c52f7d17c2b043a18f33 100644 (file)
@@ -247,7 +247,7 @@ struct branch_info {
        enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
 };
 
-static struct string_list branch_list;
+static struct string_list branch_list = STRING_LIST_INIT_NODUP;
 
 static const char *abbrev_ref(const char *name, const char *prefix)
 {
@@ -948,7 +948,7 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
        struct show_info *show_info = cb_data;
        struct branch_info *branch_info = item->util;
        struct string_list *merge = &branch_info->merge;
-       const char *also;
+       int width = show_info->width + 4;
        int i;
 
        if (branch_info->rebase && branch_info->merge.nr > 1) {
@@ -959,19 +959,18 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
 
        printf("    %-*s ", show_info->width, item->string);
        if (branch_info->rebase) {
-               printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
-                       "rebases interactively onto remote %s" :
-                       "rebases onto remote %s"), merge->items[0].string);
+               printf_ln(branch_info->rebase == INTERACTIVE_REBASE
+                         ? _("rebases interactively onto remote %s")
+                         : _("rebases onto remote %s"), merge->items[0].string);
                return 0;
        } else if (show_info->any_rebase) {
                printf_ln(_(" merges with remote %s"), merge->items[0].string);
-               also = _("    and with remote");
+               width++;
        } else {
                printf_ln(_("merges with remote %s"), merge->items[0].string);
-               also = _("   and with remote");
        }
        for (i = 1; i < merge->nr; i++)
-               printf("    %-*s %s %s\n", show_info->width, "", also,
+               printf(_("%-*s    and with remote %s\n"), width, "",
                       merge->items[i].string);
 
        return 0;
@@ -1150,13 +1149,15 @@ static int show(int argc, const char **argv)
                        url_nr = states.remote->url_nr;
                }
                for (i = 0; i < url_nr; i++)
+                       /* TRANSLATORS: the colon ':' should align with
+                          the one in "  Fetch URL: %s" translation */
                        printf_ln(_("  Push  URL: %s"), url[i]);
                if (!i)
-                       printf_ln(_("  Push  URL: %s"), "(no URL)");
+                       printf_ln(_("  Push  URL: %s"), _("(no URL)"));
                if (no_query)
-                       printf_ln(_("  HEAD branch: %s"), "(not queried)");
+                       printf_ln(_("  HEAD branch: %s"), _("(not queried)"));
                else if (!states.heads.nr)
-                       printf_ln(_("  HEAD branch: %s"), "(unknown)");
+                       printf_ln(_("  HEAD branch: %s"), _("(unknown)"));
                else if (states.heads.nr == 1)
                        printf_ln(_("  HEAD branch: %s"), states.heads.items[0].string);
                else {