Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-08-01 04:28:59 +0400
committerJunio C Hamano <gitster@pobox.com>2007-08-01 11:38:30 +0400
commite5392c51469c25851f9c6e53165d75fc61901768 (patch)
tree9fc9e6a7b22c40694e5bb6994c599da1a159d96e /cache.h
parent73a7a65663223d08d8cabac8d873de21b7e9678d (diff)
Add is_absolute_path() and make_absolute_path()
This patch adds convenience functions to work with absolute paths. The function is_absolute_path() should help the efforts to integrate the MinGW fork. Note that make_absolute_path() returns a pointer to a static buffer. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 53801b8089..98af53040d 100644
--- a/cache.h
+++ b/cache.h
@@ -358,6 +358,11 @@ int git_config_perm(const char *var, const char *value);
int adjust_shared_perm(const char *path);
int safe_create_leading_directories(char *path);
char *enter_repo(char *path, int strict);
+static inline int is_absolute_path(const char *path)
+{
+ return path[0] == '/';
+}
+const char *make_absolute_path(const char *path);
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
extern int sha1_object_info(const unsigned char *, unsigned long *);