1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-25 14:46:09 +02:00

sha1-name.c: move around the collect_ambiguous() function

A subsequent change will make use of this static function in the
get_short_oid() function, which is defined above where the
collect_ambiguous() function is now. Without this we'd then have a
compilation error due to a forward declaration.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2018-05-10 12:43:01 +00:00 committed by Junio C Hamano
parent 89f32a92b4
commit a885c93b5c

View File

@ -372,6 +372,12 @@ static int show_ambiguous_object(const struct object_id *oid, void *data)
return 0;
}
static int collect_ambiguous(const struct object_id *oid, void *data)
{
oid_array_append(data, oid);
return 0;
}
static int get_short_oid(const char *name, int len, struct object_id *oid,
unsigned flags)
{
@ -421,12 +427,6 @@ static int get_short_oid(const char *name, int len, struct object_id *oid,
return status;
}
static int collect_ambiguous(const struct object_id *oid, void *data)
{
oid_array_append(data, oid);
return 0;
}
int for_each_abbrev(const char *prefix, each_abbrev_fn fn, void *cb_data)
{
struct oid_array collect = OID_ARRAY_INIT;