Skip to content

Commit

Permalink
Fix parsing of --no-prefix argument
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed May 30, 2024
1 parent c96dd26 commit de984e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Release notes
master
------

Bug fixes:

- Fix parsing of `--no-prefix` argument.

Improvements:

- Open the blob corresponding to the diff line. (#1334)
Expand Down
13 changes: 10 additions & 3 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ update_options_from_argv(const char *argv[])
/* Keep the flag in argv. */
}

if (!strcmp(flag, "--no-prefix")) {
opt_diff_noprefix = true;
mark_option_seen(&opt_diff_noprefix);
/* Keep the flag in argv. */
}

argv[flags_pos++] = flag;
}

Expand Down Expand Up @@ -1531,10 +1537,11 @@ read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen
else if (!strcmp(name, "core.abbrev"))
parse_int(&opt_id_width, value, 0, SIZEOF_REV - 1);

else if (!strcmp(name, "diff.noprefix"))
parse_bool(&opt_diff_noprefix, value);
else if (!strcmp(name, "diff.noprefix")) {
if (!find_option_info_by_value(&opt_diff_noprefix)->seen)
parse_bool(&opt_diff_noprefix, value);

else if (!strcmp(name, "status.showuntrackedfiles"))
} else if (!strcmp(name, "status.showuntrackedfiles"))
opt_status_show_untracked_files = !!strcmp(value, "no"),
opt_status_show_untracked_dirs = !strcmp(value, "all");

Expand Down

0 comments on commit de984e2

Please sign in to comment.