Skip to content

Commit

Permalink
Fix staging with diff.noprefix and --no-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed Jun 3, 2024
1 parent de984e2 commit 2e60ebd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ master

Bug fixes:

- Fix parsing of `--no-prefix` argument.
- Fix various issues with `diff.noprefix` and `--no-prefix`.

Improvements:

Expand Down
2 changes: 2 additions & 0 deletions src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2e60ebd

Please sign in to comment.