summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 3397aad1d..936a6b4cc 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -746,4 +746,16 @@ int gitfo_readlink__w32(const char *link, char *target, size_t target_len)
return dwRet;
}
+int gitfo_hide_directory__w32(const char *path)
+{
+ int error;
+
+ error = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) != 0 ?
+ GIT_SUCCESS : GIT_ERROR; /* MSDN states a "non zero" value indicates a success */
+
+ if (error < GIT_SUCCESS)
+ error = git__throw(GIT_EOSERR, "Failed to hide directory '%s'", path);
+
+ return error;
+}
#endif