remote: convert struct push_cas to struct object_id
This gets rid of one use of get_sha1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
cd73de4714
commit
b8566f8ff9
6
remote.c
6
remote.c
@ -2294,8 +2294,8 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
|
|||||||
if (!*colon)
|
if (!*colon)
|
||||||
entry->use_tracking = 1;
|
entry->use_tracking = 1;
|
||||||
else if (!colon[1])
|
else if (!colon[1])
|
||||||
hashclr(entry->expect);
|
oidclr(&entry->expect);
|
||||||
else if (get_sha1(colon + 1, entry->expect))
|
else if (get_oid(colon + 1, &entry->expect))
|
||||||
return error("cannot parse expected object name '%s'", colon + 1);
|
return error("cannot parse expected object name '%s'", colon + 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2342,7 +2342,7 @@ static void apply_cas(struct push_cas_option *cas,
|
|||||||
continue;
|
continue;
|
||||||
ref->expect_old_sha1 = 1;
|
ref->expect_old_sha1 = 1;
|
||||||
if (!entry->use_tracking)
|
if (!entry->use_tracking)
|
||||||
hashcpy(ref->old_oid_expect.hash, cas->entry[i].expect);
|
oidcpy(&ref->old_oid_expect, &entry->expect);
|
||||||
else if (remote_tracking(remote, ref->name, &ref->old_oid_expect))
|
else if (remote_tracking(remote, ref->name, &ref->old_oid_expect))
|
||||||
oidclr(&ref->old_oid_expect);
|
oidclr(&ref->old_oid_expect);
|
||||||
return;
|
return;
|
||||||
|
2
remote.h
2
remote.h
@ -282,7 +282,7 @@ struct ref *get_stale_heads(struct refspec *refs, int ref_count, struct ref *fet
|
|||||||
struct push_cas_option {
|
struct push_cas_option {
|
||||||
unsigned use_tracking_for_rest:1;
|
unsigned use_tracking_for_rest:1;
|
||||||
struct push_cas {
|
struct push_cas {
|
||||||
unsigned char expect[20];
|
struct object_id expect;
|
||||||
unsigned use_tracking:1;
|
unsigned use_tracking:1;
|
||||||
char *refname;
|
char *refname;
|
||||||
} *entry;
|
} *entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user