Skip to content

Commit 99d8cc7

Browse files
prertikgitster
authored andcommitted
builtin rebase: support ignore-whitespace option
This commit adds support for the `--ignore-whitespace` option of the rebase command. This option is simply passed to the `--am` backend. Signed-off-by: Pratik Karki <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 38dbcef commit 99d8cc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

builtin/rebase.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
527527
ACTION_SHOW_CURRENT_PATCH,
528528
} action = NO_ACTION;
529529
int committer_date_is_author_date = 0;
530+
int ignore_whitespace = 0;
530531
struct option builtin_rebase_options[] = {
531532
OPT_STRING(0, "onto", &options.onto_name,
532533
N_("revision"),
@@ -542,6 +543,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
542543
{OPTION_NEGBIT, 'n', "no-stat", &options.flags, NULL,
543544
N_("do not show diffstat of what changed upstream"),
544545
PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
546+
OPT_BOOL(0, "ignore-whitespace", &ignore_whitespace,
547+
N_("passed to 'git apply'")),
545548
OPT_BOOL(0, "signoff", &options.signoff,
546549
N_("add a Signed-off-by: line to each commit")),
547550
OPT_BOOL(0, "committer-date-is-author-date",
@@ -773,6 +776,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
773776
options.flags |= REBASE_FORCE;
774777
}
775778

779+
if (ignore_whitespace)
780+
strbuf_addstr(&options.git_am_opt, " --ignore-whitespace");
781+
776782
switch (options.type) {
777783
case REBASE_MERGE:
778784
case REBASE_INTERACTIVE:

0 commit comments

Comments
 (0)