Subject: [PATCH v2 13/12] git-compat-util: fix CONST_OUTPARAM typo and indentation

From: Jeff King <[email-masked]>
Date: Sat, 4 Apr 2026 01:42:11 -0400

On Fri, Apr 03, 2026 at 01:13:11PM +0200, Toon Claes wrote:

> > +/*
> > + * Check that an out-parameter that is "at least as const as" a matching
> > + * in-parameter. For example, skip_prefix() will return "out" that is a subset
> > + * of "str". So:
> > + *
> > + *  const str, const out: ok
> > + *  non-const str, const out: ok
> > + *  non-const str, non-const out: ok
> > + *  const str, non-const out: compile error
> > + *
> > + *  See the skip_prefix macro below for an example of use.
> > + */
> > +#define CONST_OUTPARAM(in, out) \
> > +    ((const char **)(0 ? ((*(out) = (in)),(out)) : (out)))
> 
> I'm not sure it matters, but this is indented with spaces

This is in 'next', so we'd need a patch on top. Maybe not worth it on
its own, but we also missed the typo-fix that Junio pointed out earlier.

So maybe this on top:

-- >8 --
Subject: [PATCH] git-compat-util: fix CONST_OUTPARAM typo and indentation

There's a typo in the comment, making it hard to understand. And the
macro itself is indented with spaces rather than tab.

Signed-off-by: Jeff King <[email-masked]>
---
 git-compat-util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 4ddac61992..ae1bdc90a4 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -464,7 +464,7 @@ report_fn get_warn_routine(void);
 void set_die_is_recursing_routine(int (*routine)(void));
 
 /*
- * Check that an out-parameter that is "at least as const as" a matching
+ * Check that an out-parameter is "at least as const as" a matching
  * in-parameter. For example, skip_prefix() will return "out" that is a subset
  * of "str". So:
  *
@@ -476,7 +476,7 @@ void set_die_is_recursing_routine(int (*routine)(void));
  *  See the skip_prefix macro below for an example of use.
  */
 #define CONST_OUTPARAM(in, out) \
-    ((const char **)(0 ? ((*(out) = (in)),(out)) : (out)))
+	((const char **)(0 ? ((*(out) = (in)),(out)) : (out)))
 
 /*
  * If the string "str" begins with the string found in "prefix", return true.
-- 
2.54.0.rc0.409.g4c76eb20e4