Skip to content

Commit

Permalink
stash: get git_stash_config at the top level
Browse files Browse the repository at this point in the history
In the next commit we're adding another config variable to be read
from 'git_stash_config', that is valid for the top level command
instead of just a subset.  Move the 'git_config' invocation for
'git_stash_config' to the top-level to prepare for that.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
tgummerer authored and gitster committed Mar 3, 2020
1 parent 2d2118b commit b0c7362
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin/stash.c
Expand Up @@ -712,7 +712,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)
show_patch = git_config_bool(var, value);
return 0;
}
return git_default_config(var, value, cb);
return git_diff_basic_config(var, value, cb);
}

static int show_stash(int argc, const char **argv, const char *prefix)
Expand Down Expand Up @@ -749,7 +749,6 @@ static int show_stash(int argc, const char **argv, const char *prefix)
* any options.
*/
if (revision_args.argc == 1) {
git_config(git_stash_config, NULL);
if (show_stat)
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT;

Expand Down Expand Up @@ -1573,7 +1572,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
trace_repo_setup(prefix);
setup_work_tree();

git_config(git_diff_basic_config, NULL);
git_config(git_stash_config, NULL);

argc = parse_options(argc, argv, prefix, options, git_stash_usage,
PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);
Expand Down

0 comments on commit b0c7362

Please sign in to comment.