diff options
| author | Vicent Martà <vicent@github.com> | 2012-08-19 01:26:06 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-08-19 01:26:06 -0700 |
| commit | f98c32f3fea0d5532db2d5733418aa62648b9e93 (patch) | |
| tree | 5b53901f1848d73a72765ec014e2ad5188316eb4 /src/win32 | |
| parent | 1a10fded40875f986164b80c6efd414cd1507cb8 (diff) | |
| parent | eb87800ab631d19a7655f01ece130455b1cc976a (diff) | |
| download | libgit2-f98c32f3fea0d5532db2d5733418aa62648b9e93.tar.gz | |
Merge pull request #778 from ben/clone
Clone
Diffstat (limited to 'src/win32')
| -rw-r--r-- | src/win32/posix.h | 1 | ||||
| -rw-r--r-- | src/win32/posix_w32.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/win32/posix.h b/src/win32/posix.h index baa4a3b4e..14caae418 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -33,6 +33,7 @@ GIT_INLINE(int) p_mkdir(const char *path, mode_t mode) extern int p_unlink(const char *path); extern int p_lstat(const char *file_name, struct stat *buf); extern int p_readlink(const char *link, char *target, size_t target_len); +extern int p_symlink(const char *old, const char *new); extern int p_hide_directory__w32(const char *path); extern char *p_realpath(const char *orig_path, char *buffer); extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr); diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c index e1471cab4..aa34ad3ac 100644 --- a/src/win32/posix_w32.c +++ b/src/win32/posix_w32.c @@ -7,6 +7,7 @@ #include "../posix.h" #include "path.h" #include "utf-conv.h" +#include "repository.h" #include <errno.h> #include <io.h> #include <fcntl.h> @@ -224,6 +225,14 @@ int p_readlink(const char *link, char *target, size_t target_len) return dwRet; } +int p_symlink(const char *old, const char *new) +{ + /* Real symlinks on NTFS require admin privileges. Until this changes, + * libgit2 just creates a text file with the link target in the contents. + */ + return git_futils_fake_symlink(old, new); +} + int p_open(const char *path, int flags, ...) { int fd; |
