summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/transport.c b/transport.c
index 417ed7f..c83f3b7 100644
--- a/transport.c
+++ b/transport.c
@@ -116,8 +116,8 @@ struct git_transport_data {
struct child_process *conn;
int fd[2];
unsigned got_remote_heads : 1;
- struct sha1_array extra_have;
- struct sha1_array shallow;
+ struct oid_array extra_have;
+ struct oid_array shallow;
};
static int set_git_option(struct git_transport_options *opts,
@@ -447,7 +447,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count,
static int measure_abbrev(const struct object_id *oid, int sofar)
{
- char hex[GIT_SHA1_HEXSZ + 1];
+ char hex[GIT_MAX_HEXSZ + 1];
int w = find_unique_abbrev_r(hex, oid->hash, DEFAULT_ABBREV);
return (w < sofar) ? sofar : w;
@@ -1023,19 +1023,20 @@ int transport_push(struct transport *transport,
TRANSPORT_RECURSE_SUBMODULES_ONLY)) &&
!is_bare_repository()) {
struct ref *ref = remote_refs;
- struct sha1_array commits = SHA1_ARRAY_INIT;
+ struct oid_array commits = OID_ARRAY_INIT;
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
- sha1_array_append(&commits, ref->new_oid.hash);
+ oid_array_append(&commits,
+ &ref->new_oid);
if (!push_unpushed_submodules(&commits,
transport->remote->name,
pretend)) {
- sha1_array_clear(&commits);
+ oid_array_clear(&commits);
die("Failed to push all needed submodules!");
}
- sha1_array_clear(&commits);
+ oid_array_clear(&commits);
}
if (((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) ||
@@ -1044,19 +1045,20 @@ int transport_push(struct transport *transport,
!pretend)) && !is_bare_repository()) {
struct ref *ref = remote_refs;
struct string_list needs_pushing = STRING_LIST_INIT_DUP;
- struct sha1_array commits = SHA1_ARRAY_INIT;
+ struct oid_array commits = OID_ARRAY_INIT;
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
- sha1_array_append(&commits, ref->new_oid.hash);
+ oid_array_append(&commits,
+ &ref->new_oid);
if (find_unpushed_submodules(&commits, transport->remote->name,
&needs_pushing)) {
- sha1_array_clear(&commits);
+ oid_array_clear(&commits);
die_with_unpushed_submodules(&needs_pushing);
}
string_list_clear(&needs_pushing, 0);
- sha1_array_clear(&commits);
+ oid_array_clear(&commits);
}
if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY))