Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: return positive from git_config_parse_key()
git_config_parse_key() returns #define-d error codes, but negated. This negation is merely a convenience to other parts of config.c that don't bother inspecting the return value before passing it along. But: a) There's no good reason why those callers couldn't negate the value themselves. b) This requires sanitization of the negative value when we want to exit(3) with the relevant error code. c) We want to move that into a separate library, and returning only negative values no longer makes as much sense. Change git_config_parse_key() to return positive values instead, and adjust callers accordingly. Callers that sanitize the negative sign for exit(3) now pass the return value opaquely. Callers that secretly needed the negative sign now negate the return value themselves. In doing so, we also fix a bug where "git config <key with no section or name>" results in a different exit code depending on whether we are setting or getting config. Signed-off-by: Glen Choo <[email protected]>
- Loading branch information