@@ -1,4 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "abspath.h"
+#include "strbuf.h"
/*
* Do not use this for inspecting *tracked* content. When path is a
new file mode 100644
@@ -0,0 +1,30 @@
+#ifndef ABSPATH_H
+#define ABSPATH_H
+
+int is_directory(const char *);
+char *strbuf_realpath(struct strbuf *resolved, const char *path,
+ int die_on_error);
+char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path,
+ int die_on_error);
+char *real_pathdup(const char *path, int die_on_error);
+const char *absolute_path(const char *path);
+char *absolute_pathdup(const char *path);
+
+/*
+ * Concatenate "prefix" (if len is non-zero) and "path", with no
+ * connecting characters (so "prefix" should end with a "/").
+ * Unlike prefix_path, this should be used if the named file does
+ * not have to interact with index entry; i.e. name of a random file
+ * on the filesystem.
+ *
+ * The return value is always a newly allocated string (even if the
+ * prefix was empty).
+ */
+char *prefix_filename(const char *prefix, const char *path);
+
+static inline int is_absolute_path(const char *path)
+{
+ return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
+}
+
+#endif /* ABSPATH_H */
@@ -8,6 +8,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "object-store.h"
@@ -1,4 +1,5 @@
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "builtin.h"
#include "exec-cmd.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "gettext.h"
#include "parse-options.h"
#include "strbuf.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "gettext.h"
#include "strvec.h"
#include "parse-options.h"
@@ -8,6 +8,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
#include "dir.h"
@@ -10,6 +10,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "color.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "gettext.h"
#include "parse-options.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "gettext.h"
#include "parse-options.h"
#include "diagnose.h"
@@ -13,6 +13,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "builtin.h"
#include "run-command.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "gettext.h"
#include "hex.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -11,6 +11,7 @@
*/
#include "builtin.h"
+#include "abspath.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
@@ -5,6 +5,7 @@
* Copyright (C) Junio C Hamano, 2005
*/
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
@@ -4,6 +4,7 @@
* Copyright (C) Linus Torvalds, 2005
*/
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"
#include "refs.h"
@@ -5,6 +5,7 @@
* 2006 Junio Hamano
*/
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -3,6 +3,7 @@
* email to figure out authorship and subject
*/
#include "cache.h"
+#include "abspath.h"
#include "builtin.h"
#include "gettext.h"
#include "utf8.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
#include "gettext.h"
@@ -8,6 +8,7 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "environment.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
#include "gettext.h"
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -6,6 +6,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "gettext.h"
#include "hex.h"
#include "run-command.h"
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "abspath.h"
#include "repository.h"
#include "config.h"
#include "gettext.h"
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "commit.h"
@@ -1,5 +1,6 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
@@ -1,5 +1,6 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "gettext.h"
#include "hex.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "checkout.h"
#include "config.h"
#include "builtin.h"
@@ -598,18 +598,6 @@ const char *setup_git_directory(void);
char *prefix_path(const char *prefix, int len, const char *path);
char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
-/*
- * Concatenate "prefix" (if len is non-zero) and "path", with no
- * connecting characters (so "prefix" should end with a "/").
- * Unlike prefix_path, this should be used if the named file does
- * not have to interact with index entry; i.e. name of a random file
- * on the filesystem.
- *
- * The return value is always a newly allocated string (even if the
- * prefix was empty).
- */
-char *prefix_filename(const char *prefix, const char *path);
-
int check_filename(const char *prefix, const char *name);
void verify_filename(const char *prefix,
const char *name,
@@ -1157,18 +1145,6 @@ char *interpolate_path(const char *path, int real_home);
/* NEEDSWORK: remove this synonym once in-flight topics have migrated */
#define expand_user_path interpolate_path
const char *enter_repo(const char *path, int strict);
-static inline int is_absolute_path(const char *path)
-{
- return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
-}
-int is_directory(const char *);
-char *strbuf_realpath(struct strbuf *resolved, const char *path,
- int die_on_error);
-char *strbuf_realpath_forgiving(struct strbuf *resolved, const char *path,
- int die_on_error);
-char *real_pathdup(const char *path, int die_on_error);
-const char *absolute_path(const char *path);
-char *absolute_pathdup(const char *path);
const char *remove_leading_path(const char *in, const char *prefix);
const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "chdir-notify.h"
#include "list.h"
#include "strbuf.h"
@@ -2,6 +2,7 @@
#define COMPAT_DISK_H
#include "git-compat-util.h"
+#include "abspath.h"
#include "gettext.h"
static int get_disk_info(struct strbuf *out)
@@ -7,6 +7,7 @@
#include "../strbuf.h"
#include "../run-command.h"
#include "../cache.h"
+#include "../abspath.h"
#include "../alloc.h"
#include "win32/lazyload.h"
#include "../config.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "gettext.h"
#include "simple-ipc.h"
#include "strbuf.h"
@@ -6,6 +6,7 @@
*
*/
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "date.h"
#include "branch.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "credential.h"
#include "gettext.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "pkt-line.h"
@@ -5,6 +5,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "color.h"
#include "commit.h"
#include "blob.h"
@@ -2,6 +2,7 @@
* Copyright (C) 2005 Junio C Hamano
*/
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -6,6 +6,7 @@
* Junio Hamano, 2005-2006
*/
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "dir.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"
#include "strbuf.h"
@@ -8,6 +8,7 @@
* are.
*/
#include "cache.h"
+#include "abspath.h"
#include "branch.h"
#include "environment.h"
#include "gettext.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "exec-cmd.h"
#include "gettext.h"
#include "quote.h"
@@ -3,6 +3,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "exec-cmd.h"
#include "gettext.h"
#include "strbuf.h"
@@ -3,6 +3,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "gettext.h"
#include "lockfile.h"
@@ -1,4 +1,5 @@
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "csum-file.h"
@@ -7,6 +7,7 @@
* creation etc.
*/
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -1,5 +1,6 @@
#include "git-compat-util.h"
#include "parse-options.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
#include "commit.h"
@@ -2,6 +2,7 @@
* Utilities for paths and pathnames
*/
#include "cache.h"
+#include "abspath.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "dir.h"
#include "gettext.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -4,6 +4,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "repository.h"
#include "object-store.h"
#include "config.h"
@@ -1,4 +1,5 @@
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "gettext.h"
@@ -3,6 +3,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "gettext.h"
#include "parse-options.h"
#include "config.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "environment.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "gettext.h"
#include "repository.h"
#include "config.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "environment.h"
#include "gettext.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "repository.h"
#include "config.h"
@@ -1,5 +1,6 @@
#include "test-tool.h"
#include "cache.h"
+#include "abspath.h"
#include "string-list.h"
#include "utf8.h"
@@ -1,5 +1,6 @@
#include "cache.h"
#include "tmp-objdir.h"
+#include "abspath.h"
#include "chdir-notify.h"
#include "dir.h"
#include "sigchain.h"
@@ -22,6 +22,7 @@
*/
#include "cache.h"
+#include "abspath.h"
#include "quote.h"
struct trace_key trace_default_key = { "GIT_TRACE", 0, 0, 0 };
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "sigchain.h"
#include "trace2/tr2_dst.h"
#include "trace2/tr2_sid.h"
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "gettext.h"
#include "repository.h"
@@ -2,6 +2,7 @@
* Various trivial helper wrappers around standard functions
*/
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "gettext.h"