]> git.ipfire.org Git - thirdparty/git.git/commitdiff
symlinks.h: move declarations for symlinks.c functions from cache.h
authorElijah Newren <newren@gmail.com>
Sat, 22 Apr 2023 20:17:09 +0000 (20:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Apr 2023 19:47:31 +0000 (12:47 -0700)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 files changed:
apply.c
builtin/checkout.c
builtin/update-index.c
cache.h
compat/mingw.c
diff-lib.c
dir.c
entry.c
merge-recursive.c
parallel-checkout.c
pathspec.c
preload-index.c
read-cache.c
run-command.c
symlinks.c
symlinks.h [new file with mode: 0644]
unpack-trees.c

diff --git a/apply.c b/apply.c
index 2868cef5ddd91efb65817b0a1604fb6ba4c7bc50..efe2dcb0e62ec7ef2b34075a0faa20f01883c296 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -30,6 +30,7 @@
 #include "apply.h"
 #include "entry.h"
 #include "setup.h"
+#include "symlinks.h"
 #include "wrapper.h"
 
 struct gitdiff_data {
index 6f5d82ed3d3b8944676739b99325c7ad28e9b425..715eeb5048f99a1b27cd859596b03bc4f073081a 100644 (file)
@@ -28,6 +28,7 @@
 #include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "symlinks.h"
 #include "trace2.h"
 #include "tree.h"
 #include "tree-walk.h"
index 33b00cef15190467fb79e93cf5e50a251e856030..58bbc80db774cd973b39d3301fb924344b9a409d 100644 (file)
@@ -23,6 +23,7 @@
 #include "dir.h"
 #include "setup.h"
 #include "split-index.h"
+#include "symlinks.h"
 #include "fsmonitor.h"
 #include "write-or-die.h"
 
diff --git a/cache.h b/cache.h
index 71e2fe74c4fd6b45c49e987207777ab6020d6f83..ffec289dc5d0f62e50031d1a65cd4678fc4df2e4 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -593,28 +593,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,
 int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
 int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
 
-struct cache_def {
-       struct strbuf path;
-       int flags;
-       int track_flags;
-       int prefix_len_stat_func;
-};
-#define CACHE_DEF_INIT { \
-       .path = STRBUF_INIT, \
-}
-static inline void cache_def_clear(struct cache_def *cache)
-{
-       strbuf_release(&cache->path);
-}
-
-int has_symlink_leading_path(const char *name, int len);
-int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
-int check_leading_path(const char *name, int len, int warn_on_lstat_err);
-int has_dirs_only_path(const char *name, int len, int prefix_len);
-void invalidate_lstat_cache(void);
-void schedule_dir_for_removal(const char *name, int len);
-void remove_scheduled_dirs(void);
-
 struct pack_window {
        struct pack_window *next;
        unsigned char *base;
index abbc3faf32f428bc75edaa311ef8cb3d6cd8ab7a..d06cdc6254fbc34eabcd1130c08ae6b8f1fcae01 100644 (file)
@@ -13,6 +13,7 @@
 #include "../config.h"
 #include "../environment.h"
 #include "../trace2.h"
+#include "../symlinks.h"
 #include "../wrapper.h"
 #include "dir.h"
 #include "gettext.h"
index d292405a262495974eb7de0e8b6e590df024d1c8..60e979dc1bdf1633ed8a62dee944c663f30fbe8b 100644 (file)
@@ -14,6 +14,7 @@
 #include "unpack-trees.h"
 #include "refs.h"
 #include "submodule.h"
+#include "symlinks.h"
 #include "trace.h"
 #include "dir.h"
 #include "fsmonitor.h"
diff --git a/dir.c b/dir.c
index aa840995c40bebc029b609dde82b235f1a6e5b9a..ed262fa6e43ada6bb6e0224e6ff099fcf1ac273f 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -25,6 +25,7 @@
 #include "fsmonitor.h"
 #include "setup.h"
 #include "submodule-config.h"
+#include "symlinks.h"
 #include "trace2.h"
 #include "wrapper.h"
 
diff --git a/entry.c b/entry.c
index d89e61fa64196c41e67053ba8b527a7345b37b18..91a540bd29fac2320ab214020cdcc58fee0412b4 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -7,6 +7,7 @@
 #include "hex.h"
 #include "streaming.h"
 #include "submodule.h"
+#include "symlinks.h"
 #include "progress.h"
 #include "fsmonitor.h"
 #include "entry.h"
index 9875bdb11cb34c174af5d6cca53866652ad162df..d4d2ab05b2e9990bb1f832b5f9e7d700525e88db 100644 (file)
@@ -30,6 +30,7 @@
 #include "string-list.h"
 #include "submodule-config.h"
 #include "submodule.h"
+#include "symlinks.h"
 #include "tag.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
index 50fd7fe31ef91e21a5204693f1509ae8d5d55589..7f0569cc930d02b0c16263bbe6d96e4ccb652ab6 100644 (file)
@@ -10,6 +10,7 @@
 #include "run-command.h"
 #include "sigchain.h"
 #include "streaming.h"
+#include "symlinks.h"
 #include "thread-utils.h"
 #include "trace2.h"
 #include "wrapper.h"
index 6972d515f0c7dbb93292361720603d9a80bfa44e..ec335a214e275ff1787fc33e72735d0ba005c2ac 100644 (file)
@@ -8,6 +8,7 @@
 #include "attr.h"
 #include "setup.h"
 #include "strvec.h"
+#include "symlinks.h"
 #include "quote.h"
 
 /*
index 4abf9c983b28df9718415e675c1c1fa0946ebfa4..7a26b08c2133d428c59ff46485c0211afe52a06d 100644 (file)
@@ -11,6 +11,7 @@
 #include "progress.h"
 #include "thread-utils.h"
 #include "repository.h"
+#include "symlinks.h"
 #include "trace2.h"
 
 /*
index f225bf44cd0b5fd05cf74db20023f0161c9d1c89..206c003e558d63089664c950ed9cccc95ab344a0 100644 (file)
@@ -30,6 +30,7 @@
 #include "trace2.h"
 #include "varint.h"
 #include "split-index.h"
+#include "symlinks.h"
 #include "utf8.h"
 #include "fsmonitor.h"
 #include "thread-utils.h"
index e64bb08a5bf890b1afddfede3519536a714debec..d4247d5fcc68283c362453e34e7da3e94291976f 100644 (file)
@@ -5,6 +5,7 @@
 #include "gettext.h"
 #include "sigchain.h"
 #include "strvec.h"
+#include "symlinks.h"
 #include "thread-utils.h"
 #include "strbuf.h"
 #include "string-list.h"
index 27ecc93693b035179bf5cd1d53a5852480f93b39..b29e340c2da43e9ac35adcda05322b1e068017ca 100644 (file)
@@ -1,6 +1,7 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "setup.h"
+#include "symlinks.h"
 
 static int threaded_check_leading_path(struct cache_def *cache, const char *name,
                                       int len, int warn_on_lstat_err);
diff --git a/symlinks.h b/symlinks.h
new file mode 100644 (file)
index 0000000..7ae3d5b
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef SYMLINKS_H
+#define SYMLINKS_H
+
+#include "strbuf.h"
+
+struct cache_def {
+       struct strbuf path;
+       int flags;
+       int track_flags;
+       int prefix_len_stat_func;
+};
+#define CACHE_DEF_INIT { \
+       .path = STRBUF_INIT, \
+}
+static inline void cache_def_clear(struct cache_def *cache)
+{
+       strbuf_release(&cache->path);
+}
+
+int has_symlink_leading_path(const char *name, int len);
+int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
+int check_leading_path(const char *name, int len, int warn_on_lstat_err);
+int has_dirs_only_path(const char *name, int len, int prefix_len);
+void invalidate_lstat_cache(void);
+void schedule_dir_for_removal(const char *name, int len);
+void remove_scheduled_dirs(void);
+
+#endif /* SYMLINKS_H */
index c6de2ca5a7edb7f7551cce5426d22bb4334476e5..e8a5295e737a4e53c9af4d2953d3bc03deb32cec 100644 (file)
@@ -18,6 +18,7 @@
 #include "sparse-index.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "symlinks.h"
 #include "trace2.h"
 #include "fsmonitor.h"
 #include "object-store.h"