Merge branch 'ds/partial-bundle-more'
Code clean-up. * ds/partial-bundle-more: pack-objects: lazily set up "struct rev_info", don't leak bundle: output hash information in 'verify' bundle: move capabilities to end of 'verify' pack-objects: parse --filter directly into revs.filter pack-objects: move revs out of get_object_list() list-objects-filter: remove CL_ARG__FILTER
This commit is contained in:
commit
3928e902e3
@ -75,11 +75,11 @@ verify <file>::
|
|||||||
cleanly to the current repository. This includes checks on the
|
cleanly to the current repository. This includes checks on the
|
||||||
bundle format itself as well as checking that the prerequisite
|
bundle format itself as well as checking that the prerequisite
|
||||||
commits exist and are fully linked in the current repository.
|
commits exist and are fully linked in the current repository.
|
||||||
Information about additional capabilities, such as "object filter",
|
Then, 'git bundle' prints a list of missing commits, if any.
|
||||||
is printed. See "Capabilities" in link:technical/bundle-format.html
|
Finally, information about additional capabilities, such as "object
|
||||||
for more information. Finally, 'git bundle' prints a list of
|
filter", is printed. See "Capabilities" in link:technical/bundle-format.html
|
||||||
missing commits, if any. The exit code is zero for success, but
|
for more information. The exit code is zero for success, but will
|
||||||
will be nonzero if the bundle file is invalid.
|
be nonzero if the bundle file is invalid.
|
||||||
|
|
||||||
list-heads <file>::
|
list-heads <file>::
|
||||||
Lists the references defined in the bundle. If followed by a
|
Lists the references defined in the bundle. If followed by a
|
||||||
|
@ -153,11 +153,11 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
|
|||||||
args.from_promisor = 1;
|
args.from_promisor = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
|
if (skip_prefix(arg, ("--filter="), &arg)) {
|
||||||
parse_list_objects_filter(&args.filter_options, arg);
|
parse_list_objects_filter(&args.filter_options, arg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
|
if (!strcmp(arg, ("--no-filter"))) {
|
||||||
list_objects_filter_set_no_filter(&args.filter_options);
|
list_objects_filter_set_no_filter(&args.filter_options);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -237,8 +237,6 @@ static unsigned long cache_max_small_delta_size = 1000;
|
|||||||
|
|
||||||
static unsigned long window_memory_limit = 0;
|
static unsigned long window_memory_limit = 0;
|
||||||
|
|
||||||
static struct list_objects_filter_options filter_options;
|
|
||||||
|
|
||||||
static struct string_list uri_protocols = STRING_LIST_INIT_NODUP;
|
static struct string_list uri_protocols = STRING_LIST_INIT_NODUP;
|
||||||
|
|
||||||
enum missing_action {
|
enum missing_action {
|
||||||
@ -3724,9 +3722,8 @@ static void mark_bitmap_preferred_tips(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_object_list(int ac, const char **av)
|
static void get_object_list(struct rev_info *revs, int ac, const char **av)
|
||||||
{
|
{
|
||||||
struct rev_info revs;
|
|
||||||
struct setup_revision_opt s_r_opt = {
|
struct setup_revision_opt s_r_opt = {
|
||||||
.allow_exclude_promisor_objects = 1,
|
.allow_exclude_promisor_objects = 1,
|
||||||
};
|
};
|
||||||
@ -3734,10 +3731,8 @@ static void get_object_list(int ac, const char **av)
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
int save_warning;
|
int save_warning;
|
||||||
|
|
||||||
repo_init_revisions(the_repository, &revs, NULL);
|
|
||||||
save_commit_buffer = 0;
|
save_commit_buffer = 0;
|
||||||
setup_revisions(ac, av, &revs, &s_r_opt);
|
setup_revisions(ac, av, revs, &s_r_opt);
|
||||||
list_objects_filter_copy(&revs.filter, &filter_options);
|
|
||||||
|
|
||||||
/* make sure shallows are read */
|
/* make sure shallows are read */
|
||||||
is_repository_shallow(the_repository);
|
is_repository_shallow(the_repository);
|
||||||
@ -3767,13 +3762,13 @@ static void get_object_list(int ac, const char **av)
|
|||||||
}
|
}
|
||||||
die(_("not a rev '%s'"), line);
|
die(_("not a rev '%s'"), line);
|
||||||
}
|
}
|
||||||
if (handle_revision_arg(line, &revs, flags, REVARG_CANNOT_BE_FILENAME))
|
if (handle_revision_arg(line, revs, flags, REVARG_CANNOT_BE_FILENAME))
|
||||||
die(_("bad revision '%s'"), line);
|
die(_("bad revision '%s'"), line);
|
||||||
}
|
}
|
||||||
|
|
||||||
warn_on_object_refname_ambiguity = save_warning;
|
warn_on_object_refname_ambiguity = save_warning;
|
||||||
|
|
||||||
if (use_bitmap_index && !get_object_list_from_bitmap(&revs))
|
if (use_bitmap_index && !get_object_list_from_bitmap(revs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (use_delta_islands)
|
if (use_delta_islands)
|
||||||
@ -3782,24 +3777,24 @@ static void get_object_list(int ac, const char **av)
|
|||||||
if (write_bitmap_index)
|
if (write_bitmap_index)
|
||||||
mark_bitmap_preferred_tips();
|
mark_bitmap_preferred_tips();
|
||||||
|
|
||||||
if (prepare_revision_walk(&revs))
|
if (prepare_revision_walk(revs))
|
||||||
die(_("revision walk setup failed"));
|
die(_("revision walk setup failed"));
|
||||||
mark_edges_uninteresting(&revs, show_edge, sparse);
|
mark_edges_uninteresting(revs, show_edge, sparse);
|
||||||
|
|
||||||
if (!fn_show_object)
|
if (!fn_show_object)
|
||||||
fn_show_object = show_object;
|
fn_show_object = show_object;
|
||||||
traverse_commit_list(&revs,
|
traverse_commit_list(revs,
|
||||||
show_commit, fn_show_object,
|
show_commit, fn_show_object,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (unpack_unreachable_expiration) {
|
if (unpack_unreachable_expiration) {
|
||||||
revs.ignore_missing_links = 1;
|
revs->ignore_missing_links = 1;
|
||||||
if (add_unseen_recent_objects_to_traversal(&revs,
|
if (add_unseen_recent_objects_to_traversal(revs,
|
||||||
unpack_unreachable_expiration))
|
unpack_unreachable_expiration))
|
||||||
die(_("unable to add recent objects"));
|
die(_("unable to add recent objects"));
|
||||||
if (prepare_revision_walk(&revs))
|
if (prepare_revision_walk(revs))
|
||||||
die(_("revision walk setup failed"));
|
die(_("revision walk setup failed"));
|
||||||
traverse_commit_list(&revs, record_recent_commit,
|
traverse_commit_list(revs, record_recent_commit,
|
||||||
record_recent_object, NULL);
|
record_recent_object, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3872,6 +3867,21 @@ static int option_parse_unpack_unreachable(const struct option *opt,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct po_filter_data {
|
||||||
|
unsigned have_revs:1;
|
||||||
|
struct rev_info revs;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct list_objects_filter_options *po_filter_revs_init(void *value)
|
||||||
|
{
|
||||||
|
struct po_filter_data *data = value;
|
||||||
|
|
||||||
|
repo_init_revisions(the_repository, &data->revs, NULL);
|
||||||
|
data->have_revs = 1;
|
||||||
|
|
||||||
|
return &data->revs.filter;
|
||||||
|
}
|
||||||
|
|
||||||
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
int use_internal_rev_list = 0;
|
int use_internal_rev_list = 0;
|
||||||
@ -3882,6 +3892,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
|||||||
int rev_list_index = 0;
|
int rev_list_index = 0;
|
||||||
int stdin_packs = 0;
|
int stdin_packs = 0;
|
||||||
struct string_list keep_pack_list = STRING_LIST_INIT_NODUP;
|
struct string_list keep_pack_list = STRING_LIST_INIT_NODUP;
|
||||||
|
struct po_filter_data pfd = { .have_revs = 0 };
|
||||||
|
|
||||||
struct option pack_objects_options[] = {
|
struct option pack_objects_options[] = {
|
||||||
OPT_SET_INT('q', "quiet", &progress,
|
OPT_SET_INT('q', "quiet", &progress,
|
||||||
N_("do not show progress meter"), 0),
|
N_("do not show progress meter"), 0),
|
||||||
@ -3967,7 +3979,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
|||||||
&write_bitmap_index,
|
&write_bitmap_index,
|
||||||
N_("write a bitmap index if possible"),
|
N_("write a bitmap index if possible"),
|
||||||
WRITE_BITMAP_QUIET, PARSE_OPT_HIDDEN),
|
WRITE_BITMAP_QUIET, PARSE_OPT_HIDDEN),
|
||||||
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
|
OPT_PARSE_LIST_OBJECTS_FILTER_INIT(&pfd, po_filter_revs_init),
|
||||||
OPT_CALLBACK_F(0, "missing", NULL, N_("action"),
|
OPT_CALLBACK_F(0, "missing", NULL, N_("action"),
|
||||||
N_("handling for missing objects"), PARSE_OPT_NONEG,
|
N_("handling for missing objects"), PARSE_OPT_NONEG,
|
||||||
option_parse_missing_action),
|
option_parse_missing_action),
|
||||||
@ -4087,7 +4099,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
|||||||
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
|
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
|
||||||
unpack_unreachable_expiration = 0;
|
unpack_unreachable_expiration = 0;
|
||||||
|
|
||||||
if (filter_options.choice) {
|
if (pfd.have_revs && pfd.revs.filter.choice) {
|
||||||
if (!pack_to_stdout)
|
if (!pack_to_stdout)
|
||||||
die(_("cannot use --filter without --stdout"));
|
die(_("cannot use --filter without --stdout"));
|
||||||
if (stdin_packs)
|
if (stdin_packs)
|
||||||
@ -4163,8 +4175,13 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
|||||||
add_unreachable_loose_objects();
|
add_unreachable_loose_objects();
|
||||||
} else if (!use_internal_rev_list) {
|
} else if (!use_internal_rev_list) {
|
||||||
read_object_list_from_stdin();
|
read_object_list_from_stdin();
|
||||||
|
} else if (pfd.have_revs) {
|
||||||
|
get_object_list(&pfd.revs, rp.nr, rp.v);
|
||||||
} else {
|
} else {
|
||||||
get_object_list(rp.nr, rp.v);
|
struct rev_info revs;
|
||||||
|
|
||||||
|
repo_init_revisions(the_repository, &revs, NULL);
|
||||||
|
get_object_list(&revs, rp.nr, rp.v);
|
||||||
}
|
}
|
||||||
cleanup_preferred_base();
|
cleanup_preferred_base();
|
||||||
if (include_tag && nr_result)
|
if (include_tag && nr_result)
|
||||||
|
11
bundle.c
11
bundle.c
@ -267,11 +267,6 @@ int verify_bundle(struct repository *r,
|
|||||||
(uintmax_t)r->nr);
|
(uintmax_t)r->nr);
|
||||||
list_refs(r, 0, NULL);
|
list_refs(r, 0, NULL);
|
||||||
|
|
||||||
if (header->filter.choice) {
|
|
||||||
printf_ln("The bundle uses this filter: %s",
|
|
||||||
list_objects_filter_spec(&header->filter));
|
|
||||||
}
|
|
||||||
|
|
||||||
r = &header->prerequisites;
|
r = &header->prerequisites;
|
||||||
if (!r->nr) {
|
if (!r->nr) {
|
||||||
printf_ln(_("The bundle records a complete history."));
|
printf_ln(_("The bundle records a complete history."));
|
||||||
@ -282,6 +277,12 @@ int verify_bundle(struct repository *r,
|
|||||||
(uintmax_t)r->nr);
|
(uintmax_t)r->nr);
|
||||||
list_refs(r, 0, NULL);
|
list_refs(r, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf_ln("The bundle uses this hash algorithm: %s",
|
||||||
|
header->hash_algo->name);
|
||||||
|
if (header->filter.choice)
|
||||||
|
printf_ln("The bundle uses this filter: %s",
|
||||||
|
list_objects_filter_spec(&header->filter));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -285,6 +285,10 @@ int opt_parse_list_objects_filter(const struct option *opt,
|
|||||||
const char *arg, int unset)
|
const char *arg, int unset)
|
||||||
{
|
{
|
||||||
struct list_objects_filter_options *filter_options = opt->value;
|
struct list_objects_filter_options *filter_options = opt->value;
|
||||||
|
opt_lof_init init = (opt_lof_init)opt->defval;
|
||||||
|
|
||||||
|
if (init)
|
||||||
|
filter_options = init(opt->value);
|
||||||
|
|
||||||
if (unset || !arg)
|
if (unset || !arg)
|
||||||
list_objects_filter_set_no_filter(filter_options);
|
list_objects_filter_set_no_filter(filter_options);
|
||||||
|
@ -69,9 +69,6 @@ struct list_objects_filter_options {
|
|||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Normalized command line arguments */
|
|
||||||
#define CL_ARG__FILTER "filter"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse value of the argument to the "filter" keyword.
|
* Parse value of the argument to the "filter" keyword.
|
||||||
* On the command line this looks like:
|
* On the command line this looks like:
|
||||||
@ -107,13 +104,31 @@ void parse_list_objects_filter(
|
|||||||
struct list_objects_filter_options *filter_options,
|
struct list_objects_filter_options *filter_options,
|
||||||
const char *arg);
|
const char *arg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The opt->value to opt_parse_list_objects_filter() is either a
|
||||||
|
* "struct list_objects_filter_option *" when using
|
||||||
|
* OPT_PARSE_LIST_OBJECTS_FILTER().
|
||||||
|
*
|
||||||
|
* Or, if using no "struct option" field is used by the callback,
|
||||||
|
* except the "defval" which is expected to be an "opt_lof_init"
|
||||||
|
* function, which is called with the "opt->value" and must return a
|
||||||
|
* pointer to the ""struct list_objects_filter_option *" to be used.
|
||||||
|
*
|
||||||
|
* The OPT_PARSE_LIST_OBJECTS_FILTER_INIT() can be used e.g. the
|
||||||
|
* "struct list_objects_filter_option" is embedded in a "struct
|
||||||
|
* rev_info", which the "defval" could be tasked with lazily
|
||||||
|
* initializing. See cmd_pack_objects() for an example.
|
||||||
|
*/
|
||||||
int opt_parse_list_objects_filter(const struct option *opt,
|
int opt_parse_list_objects_filter(const struct option *opt,
|
||||||
const char *arg, int unset);
|
const char *arg, int unset);
|
||||||
|
typedef struct list_objects_filter_options *(*opt_lof_init)(void *);
|
||||||
|
#define OPT_PARSE_LIST_OBJECTS_FILTER_INIT(fo, init) \
|
||||||
|
{ OPTION_CALLBACK, 0, "filter", (fo), N_("args"), \
|
||||||
|
N_("object filtering"), 0, opt_parse_list_objects_filter, \
|
||||||
|
(intptr_t)(init) }
|
||||||
|
|
||||||
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
|
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
|
||||||
OPT_CALLBACK(0, CL_ARG__FILTER, fo, N_("args"), \
|
OPT_PARSE_LIST_OBJECTS_FILTER_INIT((fo), NULL)
|
||||||
N_("object filtering"), \
|
|
||||||
opt_parse_list_objects_filter)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Translates abbreviated numbers in the filter's filter_spec into their
|
* Translates abbreviated numbers in the filter's filter_spec into their
|
||||||
|
@ -2691,9 +2691,9 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
|
|||||||
revs->no_walk = 0;
|
revs->no_walk = 0;
|
||||||
} else if (!strcmp(arg, "--single-worktree")) {
|
} else if (!strcmp(arg, "--single-worktree")) {
|
||||||
revs->single_worktree = 1;
|
revs->single_worktree = 1;
|
||||||
} else if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
|
} else if (skip_prefix(arg, ("--filter="), &arg)) {
|
||||||
parse_list_objects_filter(&revs->filter, arg);
|
parse_list_objects_filter(&revs->filter, arg);
|
||||||
} else if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
|
} else if (!strcmp(arg, ("--no-filter"))) {
|
||||||
list_objects_filter_set_no_filter(&revs->filter);
|
list_objects_filter_set_no_filter(&revs->filter);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -122,6 +122,8 @@ format_and_save_expect () {
|
|||||||
sed -e 's/Z$//' >expect
|
sed -e 's/Z$//' >expect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HASH_MESSAGE="The bundle uses this hash algorithm: $GIT_DEFAULT_HASH"
|
||||||
|
|
||||||
# (C) (D, pull/1/head, topic/1)
|
# (C) (D, pull/1/head, topic/1)
|
||||||
# o --- o
|
# o --- o
|
||||||
# / \ (L)
|
# / \ (L)
|
||||||
@ -194,11 +196,12 @@ test_expect_success 'create bundle from special rev: main^!' '
|
|||||||
|
|
||||||
git bundle verify special-rev.bdl |
|
git bundle verify special-rev.bdl |
|
||||||
make_user_friendly_and_stable_output >actual &&
|
make_user_friendly_and_stable_output >actual &&
|
||||||
format_and_save_expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains this ref:
|
The bundle contains this ref:
|
||||||
<COMMIT-P> refs/heads/main
|
<COMMIT-P> refs/heads/main
|
||||||
The bundle requires this ref:
|
The bundle requires this ref:
|
||||||
<COMMIT-O> Z
|
<COMMIT-O> Z
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual &&
|
test_cmp expect actual &&
|
||||||
|
|
||||||
@ -215,12 +218,13 @@ test_expect_success 'create bundle with --max-count option' '
|
|||||||
|
|
||||||
git bundle verify max-count.bdl |
|
git bundle verify max-count.bdl |
|
||||||
make_user_friendly_and_stable_output >actual &&
|
make_user_friendly_and_stable_output >actual &&
|
||||||
format_and_save_expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains these 2 refs:
|
The bundle contains these 2 refs:
|
||||||
<COMMIT-P> refs/heads/main
|
<COMMIT-P> refs/heads/main
|
||||||
<TAG-1> refs/tags/v1
|
<TAG-1> refs/tags/v1
|
||||||
The bundle requires this ref:
|
The bundle requires this ref:
|
||||||
<COMMIT-O> Z
|
<COMMIT-O> Z
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual &&
|
test_cmp expect actual &&
|
||||||
|
|
||||||
@ -240,7 +244,7 @@ test_expect_success 'create bundle with --since option' '
|
|||||||
|
|
||||||
git bundle verify since.bdl |
|
git bundle verify since.bdl |
|
||||||
make_user_friendly_and_stable_output >actual &&
|
make_user_friendly_and_stable_output >actual &&
|
||||||
format_and_save_expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains these 5 refs:
|
The bundle contains these 5 refs:
|
||||||
<COMMIT-P> refs/heads/main
|
<COMMIT-P> refs/heads/main
|
||||||
<COMMIT-N> refs/heads/release
|
<COMMIT-N> refs/heads/release
|
||||||
@ -250,6 +254,7 @@ test_expect_success 'create bundle with --since option' '
|
|||||||
The bundle requires these 2 refs:
|
The bundle requires these 2 refs:
|
||||||
<COMMIT-M> Z
|
<COMMIT-M> Z
|
||||||
<COMMIT-K> Z
|
<COMMIT-K> Z
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual &&
|
test_cmp expect actual &&
|
||||||
|
|
||||||
@ -267,11 +272,12 @@ test_expect_success 'create bundle 1 - no prerequisites' '
|
|||||||
EOF
|
EOF
|
||||||
git bundle create stdin-1.bdl --stdin <input &&
|
git bundle create stdin-1.bdl --stdin <input &&
|
||||||
|
|
||||||
cat >expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains these 2 refs:
|
The bundle contains these 2 refs:
|
||||||
<COMMIT-D> refs/heads/topic/1
|
<COMMIT-D> refs/heads/topic/1
|
||||||
<COMMIT-H> refs/heads/topic/2
|
<COMMIT-H> refs/heads/topic/2
|
||||||
The bundle records a complete history.
|
The bundle records a complete history.
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# verify bundle, which has no prerequisites
|
# verify bundle, which has no prerequisites
|
||||||
@ -308,13 +314,14 @@ test_expect_success 'create bundle 2 - has prerequisites' '
|
|||||||
--stdin \
|
--stdin \
|
||||||
release <input &&
|
release <input &&
|
||||||
|
|
||||||
format_and_save_expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains this ref:
|
The bundle contains this ref:
|
||||||
<COMMIT-N> refs/heads/release
|
<COMMIT-N> refs/heads/release
|
||||||
The bundle requires these 3 refs:
|
The bundle requires these 3 refs:
|
||||||
<COMMIT-D> Z
|
<COMMIT-D> Z
|
||||||
<COMMIT-E> Z
|
<COMMIT-E> Z
|
||||||
<COMMIT-G> Z
|
<COMMIT-G> Z
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
git bundle verify 2.bdl |
|
git bundle verify 2.bdl |
|
||||||
@ -367,13 +374,14 @@ test_expect_success 'create bundle 3 - two refs, same object' '
|
|||||||
--stdin \
|
--stdin \
|
||||||
main HEAD <input &&
|
main HEAD <input &&
|
||||||
|
|
||||||
format_and_save_expect <<-\EOF &&
|
format_and_save_expect <<-EOF &&
|
||||||
The bundle contains these 2 refs:
|
The bundle contains these 2 refs:
|
||||||
<COMMIT-P> refs/heads/main
|
<COMMIT-P> refs/heads/main
|
||||||
<COMMIT-P> HEAD
|
<COMMIT-P> HEAD
|
||||||
The bundle requires these 2 refs:
|
The bundle requires these 2 refs:
|
||||||
<COMMIT-M> Z
|
<COMMIT-M> Z
|
||||||
<COMMIT-K> Z
|
<COMMIT-K> Z
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
git bundle verify 3.bdl |
|
git bundle verify 3.bdl |
|
||||||
@ -409,12 +417,13 @@ test_expect_success 'create bundle 4 - with tags' '
|
|||||||
--stdin \
|
--stdin \
|
||||||
--all <input &&
|
--all <input &&
|
||||||
|
|
||||||
cat >expect <<-\EOF &&
|
cat >expect <<-EOF &&
|
||||||
The bundle contains these 3 refs:
|
The bundle contains these 3 refs:
|
||||||
<TAG-1> refs/tags/v1
|
<TAG-1> refs/tags/v1
|
||||||
<TAG-2> refs/tags/v2
|
<TAG-2> refs/tags/v2
|
||||||
<TAG-3> refs/tags/v3
|
<TAG-3> refs/tags/v3
|
||||||
The bundle records a complete history.
|
The bundle records a complete history.
|
||||||
|
$HASH_MESSAGE
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
git bundle verify 4.bdl |
|
git bundle verify 4.bdl |
|
||||||
@ -510,8 +519,9 @@ do
|
|||||||
<TAG-2> refs/tags/v2
|
<TAG-2> refs/tags/v2
|
||||||
<TAG-3> refs/tags/v3
|
<TAG-3> refs/tags/v3
|
||||||
<COMMIT-P> HEAD
|
<COMMIT-P> HEAD
|
||||||
The bundle uses this filter: $filter
|
|
||||||
The bundle records a complete history.
|
The bundle records a complete history.
|
||||||
|
$HASH_MESSAGE
|
||||||
|
The bundle uses this filter: $filter
|
||||||
EOF
|
EOF
|
||||||
test_cmp expect actual &&
|
test_cmp expect actual &&
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user