summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-09-08 14:35:53 -0400
committerEdward Thomson <ethomson@microsoft.com>2015-09-08 15:56:35 -0400
commitea3f2c296aa39b9609db3d75c96837518beb12a3 (patch)
treebc431d91a58cd7008730c0e23aaa9b1018921de4
parentc1770aeb8b6893d38ba2721a1cdd9ba0d6ed610c (diff)
downloadlibgit2-ea3f2c296aa39b9609db3d75c96837518beb12a3.tar.gz
filebuf: ensure we can lock a hidden file
-rw-r--r--tests/core/filebuf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/core/filebuf.c b/tests/core/filebuf.c
index 39d98ff7e..915e3cc34 100644
--- a/tests/core/filebuf.c
+++ b/tests/core/filebuf.c
@@ -204,3 +204,29 @@ void test_core_filebuf__symlink_depth(void)
cl_git_pass(git_futils_rmdir_r(dir, NULL, GIT_RMDIR_REMOVE_FILES));
}
+
+void test_core_filebuf__hidden_file(void)
+{
+#ifndef GIT_WIN32
+ cl_skip();
+#else
+ git_filebuf file = GIT_FILEBUF_INIT;
+ char *dir = "hidden", *test = "hidden/test";
+ bool hidden;
+
+ cl_git_pass(p_mkdir(dir, 0666));
+ cl_git_mkfile(test, "dummy content");
+
+ cl_git_pass(git_win32__set_hidden(test, true));
+ cl_git_pass(git_win32__hidden(&hidden, test));
+ cl_assert(hidden);
+
+ cl_git_pass(git_filebuf_open(&file, test, 0, 0666));
+
+ cl_git_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks"));
+
+ cl_git_pass(git_filebuf_commit(&file));
+
+ git_filebuf_cleanup(&file);
+#endif
+}