Git development
 help / color / mirror / Atom feed
* [PATCH] unpack-trees: hide verify_uptodate()
@ 2026-10-28 21:03 Junio C Hamano
  2026-10-30  9:31 ` Patrick Steinhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2026-10-28 21:03 UTC (permalink / raw)
  To: git

64b1abe962 (merge-recursive: fix overwriting dirty files involved in
renames, 2018-04-19) made this function available to external callers.

With the removal of the "recursive" strategy in ad45b327c0
(merge-recursive.[ch]: thoroughly debug these, 2025-04-08), the last
external caller of this function want away.

Make it file-scope static again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 unpack-trees.c | 4 ++--
 unpack-trees.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/unpack-trees.c b/unpack-trees.c
index 1802809ad3..3298773490 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -2269,8 +2269,8 @@ static int verify_uptodate_1(const struct cache_entry *ce,
 	return add_rejected_path(o, error_type, ce->name);
 }
 
-int verify_uptodate(const struct cache_entry *ce,
-		    struct unpack_trees_options *o)
+static int verify_uptodate(const struct cache_entry *ce,
+			   struct unpack_trees_options *o)
 {
 	if (!o->skip_sparse_checkout &&
 	    (ce->ce_flags & CE_SKIP_WORKTREE) &&
diff --git a/unpack-trees.h b/unpack-trees.h
index 5867e26e17..638a6b076d 100644
--- a/unpack-trees.h
+++ b/unpack-trees.h
@@ -123,9 +123,6 @@ enum update_sparsity_result {
 enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,
 					    struct pattern_list *pl);
 
-int verify_uptodate(const struct cache_entry *ce,
-		    struct unpack_trees_options *o);
-
 int threeway_merge(const struct cache_entry * const *stages,
 		   struct unpack_trees_options *o);
 int twoway_merge(const struct cache_entry * const *src,
-- 
2.56.0-433-ga9209adf11


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] unpack-trees: hide verify_uptodate()
  2026-10-28 21:03 [PATCH] unpack-trees: hide verify_uptodate() Junio C Hamano
@ 2026-10-30  9:31 ` Patrick Steinhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Steinhardt @ 2026-10-30  9:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Wed, Oct 28, 2026 at 02:03:08PM -0700, Junio C Hamano wrote:
> 64b1abe962 (merge-recursive: fix overwriting dirty files involved in
> renames, 2018-04-19) made this function available to external callers.
> 
> With the removal of the "recursive" strategy in ad45b327c0
> (merge-recursive.[ch]: thoroughly debug these, 2025-04-08), the last

Heh, this commit message confused me for a second, until I remembered
the discussion that we had around it back then.

> external caller of this function want away.

But history checks out...

> diff --git a/unpack-trees.c b/unpack-trees.c
> index 1802809ad3..3298773490 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -2269,8 +2269,8 @@ static int verify_uptodate_1(const struct cache_entry *ce,
>  	return add_rejected_path(o, error_type, ce->name);
>  }
>  
> -int verify_uptodate(const struct cache_entry *ce,
> -		    struct unpack_trees_options *o)
> +static int verify_uptodate(const struct cache_entry *ce,
> +			   struct unpack_trees_options *o)
>  {
>  	if (!o->skip_sparse_checkout &&
>  	    (ce->ce_flags & CE_SKIP_WORKTREE) &&
> diff --git a/unpack-trees.h b/unpack-trees.h
> index 5867e26e17..638a6b076d 100644
> --- a/unpack-trees.h
> +++ b/unpack-trees.h
> @@ -123,9 +123,6 @@ enum update_sparsity_result {
>  enum update_sparsity_result update_sparsity(struct unpack_trees_options *options,
>  					    struct pattern_list *pl);
>  
> -int verify_uptodate(const struct cache_entry *ce,
> -		    struct unpack_trees_options *o);
> -

... and the diff looks good. So assuming this compiles and links the
change is obviously correct.

Thanks!

Patrick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-30  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 21:03 [PATCH] unpack-trees: hide verify_uptodate() Junio C Hamano
2026-10-30  9:31 ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox