From afd2a1d5f1fc371fe1fda0ed07e0f2f27100fbab Mon Sep 17 00:00:00 2001 From: Calvin Wan Date: Fri, 29 Sep 2023 14:20:49 -0700 Subject: wrapper: reduce scope of remove_or_warn() remove_or_warn() is only used by entry.c and apply.c, but it is currently declared and defined in wrapper.{h,c}, so it has a scope much greater than it needs. This needlessly large scope also causes wrapper.c to need to include object.h, when this file is largely unconcerned with Git objects. Move remove_or_warn() to entry.{h,c}. The file apply.c still has access to it, since it already includes entry.h for another reason. Signed-off-by: Calvin Wan Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- entry.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'entry.h') diff --git a/entry.h b/entry.h index 7329f918a9..ca3ed35bc0 100644 --- a/entry.h +++ b/entry.h @@ -62,4 +62,10 @@ int fstat_checkout_output(int fd, const struct checkout *state, struct stat *st) void update_ce_after_write(const struct checkout *state, struct cache_entry *ce, struct stat *st); +/* + * Calls the correct function out of {unlink,rmdir}_or_warn based on + * the supplied file mode. + */ +int remove_or_warn(unsigned int mode, const char *path); + #endif /* ENTRY_H */ -- cgit v1.2.3