summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-08-19 01:26:06 -0700
committerVicent Martí <vicent@github.com>2012-08-19 01:26:06 -0700
commitf98c32f3fea0d5532db2d5733418aa62648b9e93 (patch)
tree5b53901f1848d73a72765ec014e2ad5188316eb4 /src/fileops.c
parent1a10fded40875f986164b80c6efd414cd1507cb8 (diff)
parenteb87800ab631d19a7655f01ece130455b1cc976a (diff)
downloadlibgit2-f98c32f3fea0d5532db2d5733418aa62648b9e93.tar.gz
Merge pull request #778 from ben/clone
Clone
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c
index e936c3e2b..4de58b0cc 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -484,3 +484,14 @@ int git_futils_find_global_file(git_buf *path, const char *filename)
return 0;
#endif
}
+
+int git_futils_fake_symlink(const char *old, const char *new)
+{
+ int retcode = GIT_ERROR;
+ int fd = git_futils_creat_withpath(new, 0755, 0644);
+ if (fd >= 0) {
+ retcode = p_write(fd, old, strlen(old));
+ p_close(fd);
+ }
+ return retcode;
+}