Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
var: avoid a segmentation fault when
HOME
is unset
The code introduced in 576a37f (var: add attributes files locations, 2023-06-27) paid careful attention to use `xstrdup()` for pointers known never to be `NULL`, and `xstrdup_or_null()` otherwise. One spot was missed, though: `git_attr_global_file()` can return `NULL`, when the `HOME` variable is not set (and neither `XDG_CONFIG_HOME`), a scenario not too uncommon in certain server scenarios. Fix this, and add a test case to avoid future regressions. Signed-off-by: Johannes Schindelin <[email protected]>
- Loading branch information