summaryrefslogtreecommitdiff
path: root/test-sha1-array.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-02-04 11:12:38 +0200
committerJunio C Hamano <gitster@pobox.com>2016-02-04 13:18:48 -0800
commit59f929596b611d88270ac0fd3ea132b32d66d460 (patch)
tree85e899a9409daa95fbb0a73e50c6c46bdb9d5125 /test-sha1-array.c
parent754884255bb580df159e58defa81cdd30b5c430c (diff)
downloadgit-59f929596b611d88270ac0fd3ea132b32d66d460.tar.gz
fmt_ident: refactor strictness checks
This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the "default" ident, and we do so by comparing directly to the global strbuf, which violates the abstraction of the ident_default_* functions. Let's reorganize the function into a hierarchy of conditionals to handle similar cases together. The only case that doesn't just work naturally for this is that of an empty name, where our advice is different based on whether we came from ident_default_name() or not. We can use a simple flag to cover this case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-sha1-array.c')
0 files changed, 0 insertions, 0 deletions