userformat_find_requirements(): find requirement for the correct format
userformat_find_requirements(): find requirement for the correct format

This function was introduced in 5b16360 (pretty: Initialize notes if %N is
used, 2010-04-13) to check what kind of information the "log --format=..."
user format string wants. The function can be passed a NULL instead of a
format string to ask it to check user_format variable kept by an earlier
call to save_user_format().

But it unconditionally checked user_format and not the string it was
given.  The only caller introduced by the change passes NULL, which
kept the bug unnoticed, until a new GCC noticed that there is an
assignment to fmt that is never used.

Noticed-by: Chris Wilson's compiler
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>
Acked-by: Jeff King <696e3fbcf235d40b6ea1ebd61c87cbea79d444e7@peff.net>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git