Skip to content

Commit

Permalink
Update git-core to v2.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 5, 2019
1 parent c76004a commit 3a70616
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CI/tools.py
Expand Up @@ -12,7 +12,7 @@


MERCURIAL_VERSION = '5.1.2'
GIT_VERSION = '2.23.0'
GIT_VERSION = '2.24.0'

ALL_MERCURIAL_VERSIONS = (
'1.9.3', '2.0.2', '2.1.2', '2.2.3', '2.3.2', '2.4.2', '2.5.4',
Expand Down
2 changes: 1 addition & 1 deletion git-core
Submodule git-core updated from 5fa0f5 to da7293
2 changes: 1 addition & 1 deletion helper/GIT-VERSION.mk
@@ -1,2 +1,2 @@
GIT_VERSION ?= v2.23.0
GIT_VERSION ?= v2.24.0
WINDOWS_GIT_VERSION ?= $(GIT_VERSION).windows.1
7 changes: 2 additions & 5 deletions helper/cinnabar-fast-import.c
Expand Up @@ -271,11 +271,8 @@ static uintmax_t parse_mark_ref(const char *p, char **endptr)
* record_command. */
static void fill_command_buf()
{
// command_buf.buf is never free()d directly, only via cmd_list,
// which has ownership.
command_buf.buf = cmd_tail->buf;
command_buf.len = strlen(cmd_tail->buf);
command_buf.alloc = command_buf.len + 1;
strbuf_reset(&command_buf);
strbuf_addstr(&command_buf, cmd_tail->buf);
}

void maybe_reset_notes(const char *branch)
Expand Down
46 changes: 25 additions & 21 deletions helper/cinnabar-helper.c
Expand Up @@ -1600,21 +1600,25 @@ struct oid_map_entry {
struct object_id new_oid;
};

static int old2new_manifest_tree_cmp(const void *cmpdata, const void *e1,
const void *e2, const void *keydata)
static int old2new_manifest_tree_cmp(const void *cmpdata, const struct hashmap_entry *e1,
const struct hashmap_entry *e2, const void *keydata)
{
const struct old2new_manifest_tree *entry1 = e1;
const struct old2new_manifest_tree *entry2 = e2;
const struct old2new_manifest_tree *entry1 =
container_of(e1, const struct old2new_manifest_tree, ent);
const struct old2new_manifest_tree *entry2 =
container_of(e2, const struct old2new_manifest_tree, ent);

return memcmp(&entry1->old_tree, &entry2->old_tree,
sizeof(struct old_manifest_tree));
}

static int oid_map_entry_cmp(const void *cmpdata, const void *e1,
const void *e2, const void *keydata)
static int oid_map_entry_cmp(const void *cmpdata, const struct hashmap_entry *e1,
const struct hashmap_entry *e2, const void *keydata)
{
const struct oid_map_entry *entry1 = e1;
const struct oid_map_entry *entry2 = e2;
const struct oid_map_entry *entry1 =
container_of(e1, const struct oid_map_entry, ent);
const struct oid_map_entry *entry2 =
container_of(e2, const struct oid_map_entry, ent);

return oidcmp(&entry1->old_oid, &entry2->old_oid);
}
Expand All @@ -1628,7 +1632,7 @@ static void upgrade_manifest_tree_v1(const struct object_id *tree_id,

oidcpy(&k.old_oid, tree_id);
hashmap_entry_init(&k.ent, oidhash(&k.old_oid));
old2new = hashmap_get(cache, &k, NULL);
old2new = hashmap_get_entry(cache, &k, ent, NULL);
if (!old2new) {
struct strbuf tree_buf = STRBUF_INIT;
struct strbuf entry_buf = STRBUF_INIT;
Expand Down Expand Up @@ -1671,7 +1675,7 @@ static void upgrade_manifest_tree_v1(const struct object_id *tree_id,
store_git_tree(&tree_buf, reference, &old2new->new_oid);
strbuf_release(&tree_buf);
strbuf_release(&entry_buf);
hashmap_add(cache, old2new);
hashmap_add(cache, &old2new->ent);

free_tree_buffer(tree);
if (ref_state.tree)
Expand All @@ -1689,7 +1693,7 @@ static void upgrade_manifest_tree(struct old_manifest_tree *tree,

hashmap_entry_init(&k.ent, memhash(tree, sizeof(*tree)));
k.old_tree = *tree;
old2new = hashmap_get(cache, &k, NULL);
old2new = hashmap_get_entry(cache, &k, ent, NULL);
if (!old2new) {
struct old_manifest_tree_state state;
struct old_manifest_entry entry;
Expand Down Expand Up @@ -1734,7 +1738,7 @@ static void upgrade_manifest_tree(struct old_manifest_tree *tree,
store_git_tree(&tree_buf, reference, &old2new->new_tree);
strbuf_release(&tree_buf);
strbuf_release(&entry_buf);
hashmap_add(cache, old2new);
hashmap_add(cache, &old2new->ent);

free_tree_buffer(state.tree_git);
free_tree_buffer(state.tree_hg);
Expand Down Expand Up @@ -1771,7 +1775,7 @@ static void upgrade_manifest(struct commit *commit,
struct commit *p;
oidcpy(&k.old_oid, &commit->parents->item->object.oid);
hashmap_entry_init(&k.ent, oidhash(&k.old_oid));
entry = hashmap_get(&track->commit_cache, &k, NULL);
entry = hashmap_get_entry(&track->commit_cache, &k, ent, NULL);
if (!entry)
die("Something went wrong");
p = lookup_commit(the_repository, &entry->new_oid);
Expand Down Expand Up @@ -1807,7 +1811,7 @@ static void upgrade_manifest(struct commit *commit,
if (get_oid_hex(cursor, &k.old_oid))
die("Invalid sha1");
hashmap_entry_init(&k.ent, oidhash(&k.old_oid));
entry = hashmap_get(&track->commit_cache, &k, NULL);
entry = hashmap_get_entry(&track->commit_cache, &k, ent, NULL);
if (!entry)
die("Something went wrong");
oid_to_hex_r(cursor, &entry->new_oid);
Expand All @@ -1819,7 +1823,7 @@ static void upgrade_manifest(struct commit *commit,
hashmap_entry_init(&entry->ent, oidhash(&commit->object.oid));
oidcpy(&entry->old_oid, &commit->object.oid);
store_git_commit(&new_commit, &entry->new_oid);
hashmap_add(&track->commit_cache, entry);
hashmap_add(&track->commit_cache, &entry->ent);
oidset_insert(&track->manifests, &entry->new_oid);

get_manifest_oid(commit, &oid);
Expand Down Expand Up @@ -1954,8 +1958,8 @@ static void do_upgrade(struct string_list *args)
free_tree_buffer(get_commit_tree(manifest_commit));
}
}
hashmap_free(&track.commit_cache, 1);
hashmap_free(&track.tree_cache, 1);
hashmap_free_entries(&track.commit_cache, struct oid_map_entry, ent);
hashmap_free_entries(&track.tree_cache, struct oid_map_entry, ent);
oidset_clear(&track.manifests);
stop_progress(&track.progress);
}
Expand All @@ -1975,7 +1979,7 @@ static void recurse_create_git_tree(const struct object_id *tree_id,
if (!merge_tree_id) {
hashmap_entry_init(&k.ent, oidhash(tree_id));
oidcpy(&k.old_oid, tree_id);
cache_entry = hashmap_get(cache, &k, NULL);
cache_entry = hashmap_get_entry(cache, &k, ent, NULL);
}
if (!cache_entry) {
struct merge_manifest_tree_state state;
Expand Down Expand Up @@ -2059,7 +2063,7 @@ static void recurse_create_git_tree(const struct object_id *tree_id,
store_git_tree(&tree_buf, reference, cache_entry ? &cache_entry->new_oid : result);
strbuf_release(&tree_buf);
if (!merge_tree_id) {
hashmap_add(cache, cache_entry);
hashmap_add(cache, &cache_entry->ent);
}

cleanup:
Expand Down Expand Up @@ -2345,7 +2349,7 @@ static void do_reload(struct string_list *args)

oidset_clear(&hg2git_seen);

hashmap_free(&git_tree_cache, 1);
hashmap_free_entries(&git_tree_cache, struct oid_map_entry, ent);
hashmap_init(&git_tree_cache, oid_map_entry_cmp, NULL, 0);

oid_array_clear(&manifest_heads);
Expand Down Expand Up @@ -2521,7 +2525,7 @@ int cmd_main(int argc, const char *argv[])

oidset_clear(&hg2git_seen);

hashmap_free(&git_tree_cache, 1);
hashmap_free_entries(&git_tree_cache, struct oid_map_entry, ent);

return 0;
}
1 change: 1 addition & 0 deletions helper/curl-compat.c
Expand Up @@ -6,6 +6,7 @@ void curl_easy_setopt() {}
void curl_easy_strerror() {}
void curl_global_cleanup() {}
void curl_global_init() {}
void curl_global_init_mem() {}
void curl_multi_add_handle() {}
void curl_multi_cleanup() {}
void curl_multi_fdset() {}
Expand Down
18 changes: 0 additions & 18 deletions helper/fast-import.c.patch
Expand Up @@ -29,24 +29,6 @@ index b44d6a467e..201b75a75f 100644
{
unsigned int i;
struct branch *b;
@@ -1763,7 +1763,7 @@ static int read_next_command(void)
} else {
struct recent_command *rc;

- strbuf_detach(&command_buf, NULL);
+ strbuf_init(&command_buf, 0);
stdin_eof = strbuf_getline_lf(&command_buf, stdin);
if (stdin_eof)
return EOF;
@@ -1833,7 +1833,7 @@ static int parse_data(struct strbuf *sb, uintmax_t limit, uintmax_t *len_res)
char *term = xstrdup(data);
size_t term_len = command_buf.len - (data - command_buf.buf);

- strbuf_detach(&command_buf, NULL);
+ strbuf_init(&command_buf, 0);
for (;;) {
if (strbuf_getline_lf(&command_buf, stdin) == EOF)
die("EOF in data (terminator '%s' not found)", term);
@@ -2139,7 +2139,9 @@ static uintmax_t change_note_fanout(struct tree_entry *root,
* Complain if the following character is not what is expected,
* either a space or end of the string.
Expand Down
12 changes: 0 additions & 12 deletions helper/http.c.patch

This file was deleted.

12 changes: 0 additions & 12 deletions helper/notes.c.patch
Expand Up @@ -2,18 +2,6 @@ diff --git a/notes.c b/notes.c
index 75c028b300..24089afa8a 100644
--- a/notes.c
+++ b/notes.c
@@ -269,8 +269,10 @@ static int note_tree_insert(struct notes_tree *t, struct int_node *tree,
case PTR_TYPE_NOTE:
if (oideq(&l->key_oid, &entry->key_oid)) {
/* skip concatenation if l == entry */
- if (oideq(&l->val_oid, &entry->val_oid))
+ if (oideq(&l->val_oid, &entry->val_oid)) {
+ free(entry);
return 0;
+ }

ret = combine_notes(&l->val_oid,
&entry->val_oid);
@@ -415,11 +417,6 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,

if (path_len == 2 * (hashsz - prefix_len)) {
Expand Down

0 comments on commit 3a70616

Please sign in to comment.