summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-13 16:30:21 -0700
committerRussell Belfer <rb@github.com>2013-09-17 09:31:46 -0700
commit13f36ffb9e1c4fb70b44a477d716873fecfc0407 (patch)
treee5071f42071b085e90e77ffdaeb1304e19f8d0e1 /src/fileops.c
parentfa9cc14880cb50ea626c4bb0fcf1b68acdd73186 (diff)
downloadlibgit2-13f36ffb9e1c4fb70b44a477d716873fecfc0407.tar.gz
Add clar helpers for testing file equality
These are a couple of new clar helpers for testing that a file has expected contents that I extracted from the checkout code. Actually wrote this as part of an abandoned earlier attempt at a new filters API, but it will be useful now for some of the tests I'm going to write.
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 3b271e6f6..bd845e982 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -56,18 +56,8 @@ int git_futils_creat_withpath(const char *path, const mode_t dirmode, const mode
int git_futils_creat_locked(const char *path, const mode_t mode)
{
- int fd;
-
-#ifdef GIT_WIN32
- git_win32_path buf;
-
- git_win32_path_from_c(buf, path);
- fd = _wopen(buf, O_WRONLY | O_CREAT | O_TRUNC |
+ int fd = p_open(path, O_WRONLY | O_CREAT | O_TRUNC |
O_EXCL | O_BINARY | O_CLOEXEC, mode);
-#else
- fd = open(path, O_WRONLY | O_CREAT | O_TRUNC |
- O_EXCL | O_BINARY | O_CLOEXEC, mode);
-#endif
if (fd < 0) {
giterr_set(GITERR_OS, "Failed to create locked file '%s'", path);