Re: Git v2.21.0-rc0 broken on *BSD, maybe others
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2019, 17:52 UTC
- Message-ID
- <xmqq8sykevy6.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190212124323.GA11677@ash>
Duy Nguyen <pclouds@gmail.com> writes:
> The AIX problem is from d1dd94b308 (Do not print 'dangling' for > cat-file in case of ambiguity - 2019-01-17). Apparently AIX compiler > is a bit picky about enum being a strong or weak type. I like this > compiler. The below patch should do.
That would cascade down the call graph and contaminate everything (eh, rather, requiring that many places "int" needs to turn into "enum get_oid_result"), no? For starters, cache.h still says that the function would return an "int".
Show 26 quoted lines
> -- 8< --
> diff --git a/sha1-name.c b/sha1-name.c
> index d1cc77c124..6dda2c16df 100644
> --- a/sha1-name.c
> +++ b/sha1-name.c
> @@ -1820,9 +1820,11 @@ void maybe_die_on_misspelt_object_name(const char *name, const char *prefix)
> prefix, &oid, &oc);
> }
>
> -int get_oid_with_context(struct repository *repo, const char *str,
> - unsigned flags, struct object_id *oid,
> - struct object_context *oc)
> +enum get_oid_result get_oid_with_context(struct repository *repo,
> + const char *str,
> + unsigned flags,
> + struct object_id *oid,
> + struct object_context *oc)
> {
> if (flags & GET_OID_FOLLOW_SYMLINKS && flags & GET_OID_ONLY_TO_DIE)
> BUG("incompatible flags for get_sha1_with_context");
> -- 8< --
>
>
> [1] https://public-inbox.org/git/xmqqsgwwizf6.fsf@gitster-ct.c.googlers.com/
> --
> Duy