Skip to content

Commit

Permalink
Suppress warnings from "git var -l"
Browse files Browse the repository at this point in the history
For scripts using "git var -l" to read all logical variables at
once, not all per-variable warnings will be relevant.  So suppress
them.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
jrn authored and gitster committed Nov 13, 2009
1 parent d33738d commit c27b392
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ident.c
Expand Up @@ -205,7 +205,7 @@ const char *fmt_ident(const char *name, const char *email,
if ((warn_on_no_name || error_on_no_name) &&
name == git_default_name && env_hint) {
fprintf(stderr, env_hint, au_env, co_env);
env_hint = NULL; /* warn only once, for "git var -l" */
env_hint = NULL; /* warn only once */
}
if (error_on_no_name)
die("empty ident %s <%s> not allowed", name, email);
Expand Down
2 changes: 1 addition & 1 deletion var.c
Expand Up @@ -22,7 +22,7 @@ static void list_vars(void)
{
struct git_var *ptr;
for (ptr = git_vars; ptr->read; ptr++)
printf("%s=%s\n", ptr->name, ptr->read(IDENT_WARN_ON_NO_NAME));
printf("%s=%s\n", ptr->name, ptr->read(0));
}

static const char *read_var(const char *var)
Expand Down

0 comments on commit c27b392

Please sign in to comment.