get_oid_with_context(): match prototype and implementation

The get_oid_with_context() function is declared to return an enum in cache.h, but defined to return an int in sha1-name.c. The compiler notices this on AIX and rejects the build, since d1dd94b308 (Do not print 'dangling' for cat-file in case of ambiguity - 2019-01-17) was merged. Return the correct type from the implementation to fix this. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Duy Nguyen committed Feb 12, 2019 at 19:43 UTC 127b48f99fb39736b3b8da1a81ec4f7dcf1d7f63
1 file changed +5 -3
sha1-name.c
+5 -3
@@ -1820,9 +1820,11 @@ void maybe_die_on_misspelt_object_name(const char *name, const char *prefix)
1820 prefix, &oid, &oc);
1821 }
1822
1823 -int get_oid_with_context(struct repository *repo, const char *str,
1824 - unsigned flags, struct object_id *oid,
1825 - struct object_context *oc)
1823 +enum get_oid_result get_oid_with_context(struct repository *repo,
1824 + const char *str,
1825 + unsigned flags,
1826 + struct object_id *oid,
1827 + struct object_context *oc)
1828 {
1829 if (flags & GET_OID_FOLLOW_SYMLINKS && flags & GET_OID_ONLY_TO_DIE)
1830 BUG("incompatible flags for get_sha1_with_context");