summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-10-31 18:19:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-01 02:50:02 (GMT)
commitafa73c5384de1d01386e57bd575257d1420aeb21 (patch)
tree2d3b79fb98c6c72ff4445ed4638e89b95d77bd09 /diff.c
parent02f2f56bc377c287c411947d0e1482aac888f8db (diff)
downloadgit-afa73c5384de1d01386e57bd575257d1420aeb21.zip
git-afa73c5384de1d01386e57bd575257d1420aeb21.tar.gz
git-afa73c5384de1d01386e57bd575257d1420aeb21.tar.bz2
diff: add flag to indicate textconv was set via cmdline
git-show is unique in that it wants to use textconv by default except for when it is showing blobs. When asked to show a blob, show doesn't want to use textconv unless the user explicitly requested that it be used by providing the command line flag '--textconv'. Currently this is done by using a parallel set of 'touched' flags which get set every time a particular flag is set or cleared. In a future patch we want to eliminate this parallel set of flags so instead of relying on if the textconv flag has been touched, add a new flag 'TEXTCONV_SET_VIA_CMDLINE' which is only set if textconv is set to true via the command line. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 3ad9c9b..11fccbd 100644
--- a/diff.c
+++ b/diff.c
@@ -4762,9 +4762,10 @@ int diff_opt_parse(struct diff_options *options,
DIFF_OPT_SET(options, ALLOW_EXTERNAL);
else if (!strcmp(arg, "--no-ext-diff"))
DIFF_OPT_CLR(options, ALLOW_EXTERNAL);
- else if (!strcmp(arg, "--textconv"))
+ else if (!strcmp(arg, "--textconv")) {
DIFF_OPT_SET(options, ALLOW_TEXTCONV);
- else if (!strcmp(arg, "--no-textconv"))
+ DIFF_OPT_SET(options, TEXTCONV_SET_VIA_CMDLINE);
+ } else if (!strcmp(arg, "--no-textconv"))
DIFF_OPT_CLR(options, ALLOW_TEXTCONV);
else if (!strcmp(arg, "--ignore-submodules")) {
DIFF_OPT_SET(options, OVERRIDE_SUBMODULE_CONFIG);