Skip to content

Commit b5496d4

Browse files
dschogitster
authored andcommitted
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 f5eb87b commit b5496d4

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
@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)
251251
struct branch_info {
252252
char *remote_name;
253253
struct string_list merge;
254-
int rebase;
254+
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
255255
};
256256

257257
static struct string_list branch_list;
@@ -311,7 +311,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)
311311
if (v >= 0)
312312
info->rebase = v;
313313
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;
315317
}
316318
}
317319
return 0;
@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
980982

981983
printf(" %-*s ", show_info->width, item->string);
982984
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);
984988
return 0;
985989
} else if (show_info->any_rebase) {
986990
printf_ln(_(" merges with remote %s"), merge->items[0].string);

0 commit comments

Comments
 (0)