diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-31 01:39:56 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-31 08:33:55 -0700 |
commit | 98a72ddc12e13231537150607f4a6a8ff8b43854 (patch) | |
tree | b519703af87417aa54f59f80f1a2d6d9ff7f7a8c /builtin | |
parent | ee3051bd2307cdc0145aa9ed9dcacb8acfc08c40 (diff) | |
download | git-98a72ddc12e13231537150607f4a6a8ff8b43854.tar.gz |
Make sha1_array_append take a struct object_id *
Convert the callers to pass struct object_id by changing the function
declaration and definition and applying the following semantic patch:
@@
expression E1, E2;
@@
- sha1_array_append(E1, E2.hash)
+ sha1_array_append(E1, &E2)
@@
expression E1, E2;
@@
- sha1_array_append(E1, E2->hash)
+ sha1_array_append(E1, E2)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/cat-file.c | 4 | ||||
-rw-r--r-- | builtin/diff.c | 2 | ||||
-rw-r--r-- | builtin/pack-objects.c | 4 | ||||
-rw-r--r-- | builtin/pull.c | 2 | ||||
-rw-r--r-- | builtin/receive-pack.c | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 8b85cb8cf0..8fbb667170 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -413,7 +413,7 @@ static int batch_loose_object(const struct object_id *oid, const char *path, void *data) { - sha1_array_append(data, oid->hash); + sha1_array_append(data, oid); return 0; } @@ -422,7 +422,7 @@ static int batch_packed_object(const struct object_id *oid, uint32_t pos, void *data) { - sha1_array_append(data, oid->hash); + sha1_array_append(data, oid); return 0; } diff --git a/builtin/diff.c b/builtin/diff.c index 398eee00d5..a5b34eb156 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -193,7 +193,7 @@ static int builtin_diff_combined(struct rev_info *revs, if (!revs->dense_combined_merges && !revs->combine_merges) revs->dense_combined_merges = revs->combine_merges = 1; for (i = 1; i < ents; i++) - sha1_array_append(&parents, ent[i].item->oid.hash); + sha1_array_append(&parents, &ent[i].item->oid); diff_tree_combined(ent[0].item->oid.hash, &parents, revs->dense_combined_merges, revs); sha1_array_clear(&parents); diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 16517f2637..dfeacd5c37 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2739,12 +2739,12 @@ static void record_recent_object(struct object *obj, const char *name, void *data) { - sha1_array_append(&recent_objects, obj->oid.hash); + sha1_array_append(&recent_objects, &obj->oid); } static void record_recent_commit(struct commit *commit, void *data) { - sha1_array_append(&recent_objects, commit->object.oid.hash); + sha1_array_append(&recent_objects, &commit->object.oid); } static void get_object_list(int ac, const char **av) diff --git a/builtin/pull.c b/builtin/pull.c index c007900ab5..183e377147 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -344,7 +344,7 @@ static void get_merge_heads(struct sha1_array *merge_heads) continue; /* invalid line: does not start with SHA1 */ if (starts_with(sb.buf + GIT_SHA1_HEXSZ, "\tnot-for-merge\t")) continue; /* ref is not-for-merge */ - sha1_array_append(merge_heads, oid.hash); + sha1_array_append(merge_heads, &oid); } fclose(fp); strbuf_release(&sb); diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index d6097ee08c..2853ea0f99 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -842,7 +842,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si) if (si->used_shallow[i] && (si->used_shallow[i][cmd->index / 32] & mask) && !delayed_reachability_test(si, i)) - sha1_array_append(&extra, si->shallow->oid[i].hash); + sha1_array_append(&extra, &si->shallow->oid[i]); opt.env = tmp_objdir_env(tmp_objdir); setup_alternate_shallow(&shallow_lock, &opt.shallow_file, &extra); @@ -1546,7 +1546,7 @@ static struct command *read_head_info(struct sha1_array *shallow) if (get_oid_hex(line + 8, &oid)) die("protocol error: expected shallow sha, got '%s'", line + 8); - sha1_array_append(shallow, oid.hash); + sha1_array_append(shallow, &oid); continue; } @@ -1817,7 +1817,7 @@ static void update_shallow_info(struct command *commands, for (cmd = commands; cmd; cmd = cmd->next) { if (is_null_oid(&cmd->new_oid)) continue; - sha1_array_append(ref, cmd->new_oid.hash); + sha1_array_append(ref, &cmd->new_oid); cmd->index = ref->nr - 1; } si->ref = ref; |