diff options
author | Calvin Wan <calvinwan@google.com> | 2023-09-29 23:20:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-09-30 00:14:56 +0200 |
commit | afd2a1d5f1fc371fe1fda0ed07e0f2f27100fbab (patch) | |
tree | b13a88a44ba897c7f087a01be7743de3a310d2b5 /wrapper.c | |
parent | hex-ll: separate out non-hash-algo functions (diff) | |
download | git-afd2a1d5f1fc371fe1fda0ed07e0f2f27100fbab.tar.xz git-afd2a1d5f1fc371fe1fda0ed07e0f2f27100fbab.zip |
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 <calvinwan@google.com>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wrapper.c')
-rw-r--r-- | wrapper.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -5,7 +5,6 @@ #include "abspath.h" #include "config.h" #include "gettext.h" -#include "object.h" #include "repository.h" #include "strbuf.h" #include "trace2.h" @@ -632,11 +631,6 @@ int rmdir_or_warn(const char *file) return warn_if_unremovable("rmdir", file, rmdir(file)); } -int remove_or_warn(unsigned int mode, const char *file) -{ - return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file); -} - static int access_error_is_ok(int err, unsigned flag) { return (is_missing_file_error(err) || |