File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ static char *git_attr_val_system(int ident_flag UNUSED)
66
66
67
67
static char * git_attr_val_global (int ident_flag UNUSED )
68
68
{
69
- char * file = xstrdup (git_attr_global_file ());
69
+ char * file = xstrdup_or_null (git_attr_global_file ());
70
70
if (file ) {
71
71
normalize_path_copy (file , file );
72
72
return file ;
Original file line number Diff line number Diff line change @@ -268,4 +268,13 @@ test_expect_success 'listing and asking for variables are exclusive' '
268
268
test_must_fail git var -l GIT_COMMITTER_IDENT
269
269
'
270
270
271
+ test_expect_success ' `git var -l` works even without HOME' '
272
+ (
273
+ XDG_CONFIG_HOME= &&
274
+ export XDG_CONFIG_HOME &&
275
+ unset HOME &&
276
+ git var -l
277
+ )
278
+ '
279
+
271
280
test_done
You can’t perform that action at this time.
0 commit comments