diff options
author | Sean Allred <allred.sean@gmail.com> | 2022-11-26 15:17:56 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-27 01:35:55 +0100 |
commit | 26b8abc7b14754d32d994f87a45b303873565853 (patch) | |
tree | c52bd0459cd2af00bde5787b3d68459bbf44de3e /Documentation/git-var.txt | |
parent | Git 2.39-rc0 (diff) | |
download | git-26b8abc7b14754d32d994f87a45b303873565853.tar.xz git-26b8abc7b14754d32d994f87a45b303873565853.zip |
var: do not print usage() with a correct invocation
Before, git-var could print usage() even if the command was invoked
correctly with a variable defined in git_vars -- provided that its
read() function returned NULL.
Now, we only print usage() only if it was called with a logical
variable that wasn't defined -- regardless of read().
Since we now know the variable is valid when we call read_var(), we
can avoid printing usage() here (and exiting with code 129) and
instead exit quietly with code 1. While exiting with a different code
can be a breaking change, it's far better than changing the exit
status more generally from 'failure' to 'success'.
Signed-off-by: Sean Allred <allred.sean@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-var.txt')
-rw-r--r-- | Documentation/git-var.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/git-var.txt b/Documentation/git-var.txt index 6aa521fab2..0ab5bfa7d7 100644 --- a/Documentation/git-var.txt +++ b/Documentation/git-var.txt @@ -13,7 +13,8 @@ SYNOPSIS DESCRIPTION ----------- -Prints a Git logical variable. +Prints a Git logical variable. Exits with code 1 if the variable has +no value. OPTIONS ------- |