Skip to content

Commit 2fba836

Browse files
flichtenheldgitster
authored andcommitted
var: Don't require to be in a git repository.
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1658c61 commit 2fba836

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

var.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ static int show_config(const char *var, const char *value)
5151
int main(int argc, char **argv)
5252
{
5353
const char *val;
54+
int nongit;
5455
if (argc != 2) {
5556
usage(var_usage);
5657
}
5758

58-
setup_git_directory();
59+
setup_git_directory_gently(&nongit);
5960
val = NULL;
6061

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

0 commit comments

Comments
 (0)