Thread (1 message) 1 message, 1 author, 2019-02-12

Re: Git v2.21.0-rc0 broken on *BSD, maybe others

From: Junio C Hamano <hidden>
Date: 2019-02-12 17:52:06

Duy Nguyen [off-list ref] 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".
quoted hunk
-- 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help