diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-05-07 06:53:05 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-06 22:50:49 -0700 |
| commit | 813f17fd6bd9289185a50f1d1179393bd1339b9b (patch) | |
| tree | a13ed7ac2aaed959edcab80710fc575ec7555832 /commit-reach.c | |
| parent | bbb82f8dc88aee588a35615fdb10862f3b41e16c (diff) | |
attr: fix BUG() when parsing attrs outside of repo
If either the `--attr-source` option or the `GIT_ATTR_SOURCE` envvar are
set, then `compute_default_attr_source()` will try to look up the value
as a treeish. It is possible to hit that function while outside of a Git
repository though, for example when using `git grep --no-index`. In that
case, Git will hit a bug because we try to look up the main ref store
outside of a repository.
Handle the case gracefully and detect when we try to look up an attr
source without a repository.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-reach.c')
0 files changed, 0 insertions, 0 deletions
