Skip to content

Commit 5dd6d08

Browse files
committed
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27b42d1 commit 5dd6d08

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

builtin/remote.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static int add(int argc, const char **argv)
247247
struct branch_info {
248248
char *remote_name;
249249
struct string_list merge;
250-
int rebase;
250+
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
251251
};
252252

253253
static struct string_list branch_list;
@@ -307,7 +307,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)
307307
if (v >= 0)
308308
info->rebase = v;
309309
else if (!strcmp(value, "preserve"))
310-
info->rebase = 1;
310+
info->rebase = NORMAL_REBASE;
311+
else if (!strcmp(value, "interactive"))
312+
info->rebase = INTERACTIVE_REBASE;
311313
}
312314
}
313315
return 0;
@@ -964,7 +966,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
964966

965967
printf(" %-*s ", show_info->width, item->string);
966968
if (branch_info->rebase) {
967-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
969+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
970+
"rebases interactively onto remote %s" :
971+
"rebases onto remote %s"), merge->items[0].string);
968972
return 0;
969973
} else if (show_info->any_rebase) {
970974
printf_ln(_(" merges with remote %s"), merge->items[0].string);

0 commit comments

Comments
 (0)