Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 12:23:59 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-18 12:23:59 +0300
commit7bdebaa646787b98679799ee27bfb42fb7daa8ca (patch)
treeff6dc6265ac51f3af6c58d736311166839857ec0 /ref-filter.c
parent56e4af3d34f95724ac26147f26752fa90d9e0280 (diff)
parent47bd3d0c14f081a3ea32b0720f7d59559802904d (diff)
Merge branch 'sg/ref-filter-wo-repository'
"git ls-remote --sort=<thing>" can feed an object that is not yet available into the comparison machinery and segfault, which has been corrected to check such a request upfront and reject it. * sg/ref-filter-wo-repository: ref-filter: don't look for objects when outside of a repository
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 7eca436223..6c70d797a9 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -534,6 +534,10 @@ static int parse_ref_filter_atom(const struct ref_format *format,
if (ARRAY_SIZE(valid_atom) <= i)
return strbuf_addf_ret(err, -1, _("unknown field name: %.*s"),
(int)(ep-atom), atom);
+ if (valid_atom[i].source != SOURCE_NONE && !have_git_dir())
+ return strbuf_addf_ret(err, -1,
+ _("not a git repository, but the field '%.*s' requires access to object data"),
+ (int)(ep-atom), atom);
/* Add it in, including the deref prefix */
at = used_atom_cnt;