merge(3p/git): Merge git subtree at v2.29.2
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
This commit is contained in:
parent
082c006c04
commit
f4609b896f
1485 changed files with 241535 additions and 109418 deletions
24
third_party/git/object.c
vendored
24
third_party/git/object.c
vendored
|
|
@ -7,7 +7,6 @@
|
|||
#include "commit.h"
|
||||
#include "tag.h"
|
||||
#include "alloc.h"
|
||||
#include "object-store.h"
|
||||
#include "packfile.h"
|
||||
#include "commit-graph.h"
|
||||
|
||||
|
|
@ -158,13 +157,13 @@ void *create_object(struct repository *r, const struct object_id *oid, void *o)
|
|||
return obj;
|
||||
}
|
||||
|
||||
void *object_as_type(struct repository *r, struct object *obj, enum object_type type, int quiet)
|
||||
void *object_as_type(struct object *obj, enum object_type type, int quiet)
|
||||
{
|
||||
if (obj->type == type)
|
||||
return obj;
|
||||
else if (obj->type == OBJ_NONE) {
|
||||
if (type == OBJ_COMMIT)
|
||||
init_commit_node(r, (struct commit *) obj);
|
||||
init_commit_node((struct commit *) obj);
|
||||
else
|
||||
obj->type = type;
|
||||
return obj;
|
||||
|
|
@ -263,7 +262,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
|
|||
if ((obj && obj->type == OBJ_BLOB && repo_has_object_file(r, oid)) ||
|
||||
(!obj && repo_has_object_file(r, oid) &&
|
||||
oid_object_info(r, oid, NULL) == OBJ_BLOB)) {
|
||||
if (check_object_signature(repl, NULL, 0, NULL) < 0) {
|
||||
if (check_object_signature(r, repl, NULL, 0, NULL) < 0) {
|
||||
error(_("hash mismatch %s"), oid_to_hex(oid));
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -273,7 +272,8 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
|
|||
|
||||
buffer = repo_read_object_file(r, oid, &type, &size);
|
||||
if (buffer) {
|
||||
if (check_object_signature(repl, buffer, size, type_name(type)) < 0) {
|
||||
if (check_object_signature(r, repl, buffer, size,
|
||||
type_name(type)) < 0) {
|
||||
free(buffer);
|
||||
error(_("hash mismatch %s"), oid_to_hex(repl));
|
||||
return NULL;
|
||||
|
|
@ -308,6 +308,15 @@ int object_list_contains(struct object_list *list, struct object *obj)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void object_list_free(struct object_list **list)
|
||||
{
|
||||
while (*list) {
|
||||
struct object_list *p = *list;
|
||||
*list = p->next;
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A zero-length string to which object_array_entry::name can be
|
||||
* initialized without requiring a malloc/free.
|
||||
|
|
@ -480,6 +489,8 @@ struct raw_object_store *raw_object_store_new(void)
|
|||
|
||||
memset(o, 0, sizeof(*o));
|
||||
INIT_LIST_HEAD(&o->packed_git_mru);
|
||||
hashmap_init(&o->pack_map, pack_map_entry_cmp, NULL, 0);
|
||||
pthread_mutex_init(&o->replace_mutex, NULL);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
|
@ -507,6 +518,7 @@ void raw_object_store_clear(struct raw_object_store *o)
|
|||
|
||||
oidmap_free(o->replace_map, 1);
|
||||
FREE_AND_NULL(o->replace_map);
|
||||
pthread_mutex_destroy(&o->replace_mutex);
|
||||
|
||||
free_commit_graph(o->commit_graph);
|
||||
o->commit_graph = NULL;
|
||||
|
|
@ -519,6 +531,8 @@ void raw_object_store_clear(struct raw_object_store *o)
|
|||
INIT_LIST_HEAD(&o->packed_git_mru);
|
||||
close_object_store(o);
|
||||
o->packed_git = NULL;
|
||||
|
||||
hashmap_free(&o->pack_map);
|
||||
}
|
||||
|
||||
void parsed_object_pool_clear(struct parsed_object_pool *o)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue