remote: handle the config setting branch.*.rebase=interactive

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>

Johannes Schindelin committed Jan 13, 2016 at 13:17 UTC b5496d484d244bc291db0973466b76e7f679cb9f
1 file changed +7 -3
builtin/remote.c
+7 -3
@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)
251 struct branch_info {
252 char *remote_name;
253 struct string_list merge;
254 - int rebase;
254 + enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
255 };
256
257 static struct string_list branch_list;
@@ -311,7 +311,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)
311 if (v >= 0)
312 info->rebase = v;
313 else if (!strcmp(value, "preserve"))
314 - info->rebase = 1;
314 + info->rebase = NORMAL_REBASE;
315 + else if (!strcmp(value, "interactive"))
316 + info->rebase = INTERACTIVE_REBASE;
317 }
318 }
319 return 0;
@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
982
983 printf(" %-*s ", show_info->width, item->string);
984 if (branch_info->rebase) {
983 - printf_ln(_("rebases onto remote %s"), merge->items[0].string);
985 + printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
986 + "rebases interactively onto remote %s" :
987 + "rebases onto remote %s"), merge->items[0].string);
988 return 0;
989 } else if (show_info->any_rebase) {
990 printf_ln(_(" merges with remote %s"), merge->items[0].string);