remote: handle the config setting branch.*.rebase=interactive
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 13 Jan 2016 12:17:19 +0000 (13:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Jan 2016 21:00:01 +0000 (13:00 -0800)
The config variable branch.<branchname>.rebase is not only used by `git
pull`, but also by `git remote` when showing details about a remote.
Therefore, it needs to be taught to accept the newly-introduced
`interactive` value of said variable.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
index 6694cf20efdc01fb59d0b6afa41f7b1557c9b2d5..2b2ff9b7d2152ce4ac9314bc8f111c02723703e6 100644 (file)
@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)
 struct branch_info {
        char *remote_name;
        struct string_list merge;
-       int rebase;
+       enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
 };
 
 static struct string_list branch_list;
@@ -311,7 +311,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)
                        if (v >= 0)
                                info->rebase = v;
                        else if (!strcmp(value, "preserve"))
-                               info->rebase = 1;
+                               info->rebase = NORMAL_REBASE;
+                       else if (!strcmp(value, "interactive"))
+                               info->rebase = INTERACTIVE_REBASE;
                }
        }
        return 0;
@@ -980,7 +982,9 @@ 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(_("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);