Merge branch 'cc/multi-promisor'

Cleanup.

* cc/multi-promisor:
  promisor-remote: skip move_to_tail when no-op
  promisor-remote.h: drop extern from function declaration
This commit is contained in:
Junio C Hamano 2019-10-07 11:33:02 +09:00
commit 59b19bcd9f
3 changed files with 23 additions and 7 deletions

View file

@ -89,6 +89,9 @@ static struct promisor_remote *promisor_remote_lookup(const char *remote_name,
static void promisor_remote_move_to_tail(struct promisor_remote *r, static void promisor_remote_move_to_tail(struct promisor_remote *r,
struct promisor_remote *previous) struct promisor_remote *previous)
{ {
if (r->next == NULL)
return;
if (previous) if (previous)
previous->next = r->next; previous->next = r->next;
else else

View file

@ -15,10 +15,10 @@ struct promisor_remote {
const char name[FLEX_ARRAY]; const char name[FLEX_ARRAY];
}; };
extern void promisor_remote_reinit(void); void promisor_remote_reinit(void);
extern struct promisor_remote *promisor_remote_find(const char *remote_name); struct promisor_remote *promisor_remote_find(const char *remote_name);
extern int has_promisor_remote(void); int has_promisor_remote(void);
extern int promisor_remote_get_direct(struct repository *repo, int promisor_remote_get_direct(struct repository *repo,
const struct object_id *oids, const struct object_id *oids,
int oid_nr); int oid_nr);
@ -26,6 +26,6 @@ extern int promisor_remote_get_direct(struct repository *repo,
* This should be used only once from setup.c to set the value we got * This should be used only once from setup.c to set the value we got
* from the extensions.partialclone config option. * from the extensions.partialclone config option.
*/ */
extern void set_repository_format_partial_clone(char *partial_clone); void set_repository_format_partial_clone(char *partial_clone);
#endif /* PROMISOR_REMOTE_H */ #endif /* PROMISOR_REMOTE_H */

View file

@ -429,6 +429,19 @@ test_expect_success 'rev-list dies for missing objects on cmd line' '
done done
' '
test_expect_success 'single promisor remote can be re-initialized gracefully' '
# ensure one promisor is in the promisors list
rm -rf repo &&
test_create_repo repo &&
test_create_repo other &&
git -C repo remote add foo "file://$(pwd)/other" &&
git -C repo config remote.foo.promisor true &&
git -C repo config extensions.partialclone foo &&
# reinitialize the promisors list
git -C repo fetch --filter=blob:none foo
'
test_expect_success 'gc repacks promisor objects separately from non-promisor objects' ' test_expect_success 'gc repacks promisor objects separately from non-promisor objects' '
rm -rf repo && rm -rf repo &&
test_create_repo repo && test_create_repo repo &&