diff options
| author | Jakob Pfender <jpfender@elegosoft.com> | 2011-05-25 16:11:57 +0200 |
|---|---|---|
| committer | Jakob Pfender <jpfender@elegosoft.com> | 2011-06-07 12:54:37 +0200 |
| commit | 1869b31e0c99831b1de394ef8cb4d0c9ee633bea (patch) | |
| tree | 1eed3d9adbe87acbab1dd3565ab6afd905259300 /src/fileops.h | |
| parent | 4d7905c579a4a89a4894ec1cea1f593338d1042f (diff) | |
| download | libgit2-1869b31e0c99831b1de394ef8cb4d0c9ee633bea.tar.gz | |
index/fileops: Correctly process symbolic links
gitfo_exists() used to error out if the given file was a symbolic link,
due to access() returning an error code. This is not expected behaviour,
as gitfo_exists() should only check whether the file itself exists, not
its link target if it is a symbolic link.
Fix this by calling gitfo_lstat() instead, which is just a wrapper for
lstat().
Also fix the same error in index_init_entry().
Diffstat (limited to 'src/fileops.h')
| -rw-r--r-- | src/fileops.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fileops.h b/src/fileops.h index c114508db..f27f2c9e3 100644 --- a/src/fileops.h +++ b/src/fileops.h @@ -94,6 +94,7 @@ extern int gitfo_mv_force(const char *from, const char *to); #define gitfo_stat(p,b) stat(p, b) #define gitfo_fstat(f,b) fstat(f, b) +#define gitfo_lstat(p,b) lstat(p,b) #define gitfo_unlink(p) unlink(p) #define gitfo_rmdir(p) rmdir(p) |
