diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-10-07 05:32:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-07 05:32:54 +0300 |
commit | ad8f0368b45bf1ab0f1339033d0a62cee94b1ae2 (patch) | |
tree | 71a1f07b3ab935a0e2efd73b71b17bd3a4d82403 /list-objects-filter-options.c | |
parent | ba2d45112224a0bd5ba0f10ba180c88d148cec36 (diff) | |
parent | a4cafc737916c2df5a52875cb1d0976662e3ab0e (diff) |
Merge branch 'jk/partial-clone-sparse-blob'
The name of the blob object that stores the filter specification
for sparse cloning/fetching was interpreted in a wrong place in the
code, causing Git to abort.
* jk/partial-clone-sparse-blob:
list-objects-filter: use empty string instead of NULL for sparse "base"
list-objects-filter: give a more specific error sparse parsing error
list-objects-filter: delay parsing of sparse oid
t5616: test cloning/fetching with sparse:oid=<oid> filter
Diffstat (limited to 'list-objects-filter-options.c')
-rw-r--r-- | list-objects-filter-options.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index 4d88bfe64a..256bcfbdfe 100644 --- a/list-objects-filter-options.c +++ b/list-objects-filter-options.c @@ -62,17 +62,7 @@ static int gently_parse_list_objects_filter( return 0; } else if (skip_prefix(arg, "sparse:oid=", &v0)) { - struct object_context oc; - struct object_id sparse_oid; - - /* - * Try to parse <oid-expression> into an OID for the current - * command, but DO NOT complain if we don't have the blob or - * ref locally. - */ - if (!get_oid_with_context(the_repository, v0, GET_OID_BLOB, - &sparse_oid, &oc)) - filter_options->sparse_oid_value = oiddup(&sparse_oid); + filter_options->sparse_oid_name = xstrdup(v0); filter_options->choice = LOFC_SPARSE_OID; return 0; @@ -320,7 +310,7 @@ void list_objects_filter_release( if (!filter_options) return; string_list_clear(&filter_options->filter_spec, /*free_util=*/0); - free(filter_options->sparse_oid_value); + free(filter_options->sparse_oid_name); for (sub = 0; sub < filter_options->sub_nr; sub++) list_objects_filter_release(&filter_options->sub[sub]); free(filter_options->sub); |