summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c
index cb11acee3..72cb289e0 100644
--- a/src/path.c
+++ b/src/path.c
@@ -526,6 +526,17 @@ bool git_path_isfile(const char *path)
return S_ISREG(st.st_mode) != 0;
}
+bool git_path_islink(const char *path)
+{
+ struct stat st;
+
+ assert(path);
+ if (p_lstat(path, &st) < 0)
+ return false;
+
+ return S_ISLNK(st.st_mode) != 0;
+}
+
#ifdef GIT_WIN32
bool git_path_is_empty_dir(const char *path)