diff --git a/NEWS.adoc b/NEWS.adoc index d6a78f070..15280d6fa 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -6,7 +6,7 @@ master Bug fixes: - - Fix parsing of `--no-prefix` argument. + - Fix various issues with `diff.noprefix` and `--no-prefix`. Improvements: diff --git a/src/stage.c b/src/stage.c index 348cea362..646b08af6 100644 --- a/src/stage.c +++ b/src/stage.c @@ -205,6 +205,8 @@ stage_apply_chunk(struct view *view, struct line *chunk, struct line *single, if (!diff_hdr) return false; + if (opt_diff_noprefix) + apply_argv[argc++] = "-p0"; if (!revert) apply_argv[argc++] = "--cached"; if (revert || stage_line_type == LINE_STAT_STAGED)