Skip to content

Commit

Permalink
var: Don't require to be in a git repository.
Browse files Browse the repository at this point in the history
git var works fine even when not called in a git repository. So
don't require it.

This will make it possible to remove this pre-condition for some
other git commands as well.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Frank Lichtenheld authored and Junio C Hamano committed Mar 15, 2008
1 parent 1658c61 commit 2fba836
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion var.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ static int show_config(const char *var, const char *value)
int main(int argc, char **argv)
{
const char *val;
int nongit;
if (argc != 2) {
usage(var_usage);
}

setup_git_directory();
setup_git_directory_gently(&nongit);
val = NULL;

if (strcmp(argv[1], "-l") == 0) {
Expand Down

0 comments on commit 2fba836

Please sign in to comment.