]> git.ipfire.org Git - thirdparty/git.git/commitdiff
format-patch: replace erroneous and condition
authorDenton Liu <liu.denton@gmail.com>
Tue, 15 Oct 2019 09:06:35 +0000 (02:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Oct 2019 01:26:42 +0000 (10:26 +0900)
Commit 30984ed2e9 (format-patch: support deep threading, 2009-02-19),
introduced the following lines:

#define THREAD_SHALLOW 1

[...]

thread = git_config_bool(var, value) && THREAD_SHALLOW;

Since git_config_bool() returns a bool, the trailing `&& THREAD_SHALLOW`
is a no-op. Replace this errorneous and condition with a ternary
statement so that it is clear what the configured value is when a
boolean is given.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c

index 44b10b3415414c0723ace29d9defb62c1354e9d6..351f4ffcfd96dee93b01d4dd1d11de22091c37c2 100644 (file)
@@ -835,7 +835,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
                        thread = THREAD_SHALLOW;
                        return 0;
                }
-               thread = git_config_bool(var, value) && THREAD_SHALLOW;
+               thread = git_config_bool(var, value) ? THREAD_SHALLOW : THREAD_UNSET;
                return 0;
        }
        if (!strcmp(var, "format.signoff")) {