get_sha1: propagate flags to child functions