summaryrefslogtreecommitdiff
path: root/src/fileops.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | global: Properly use `git__` memory wrappersVicent Marti2011-10-281-3/+3
|/ | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* Implment p_access and use it in git_fileutils_existsCarlos Martín Nieto2011-09-231-1/+1
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Tabify everythingVicent Marti2011-09-191-6/+6
| | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* Cleanup legal dataVicent Marti2011-09-191-0/+6
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* compat: Move `mkstemp` to the POSIX compat layerVicent Marti2011-08-301-11/+3
|
* Add git_futils_readbuffer_updatedCarlos Martín Nieto2011-07-231-8/+35
| | | | | | | | | | | | | | This extends the git_fuitls_readbuffer function to only read in if the file's modification date is later than the given one. Some code paths want to check a file's modification date in order to decide whether they should read it or not. If they do want to read it, another stat call is done by futils. This function combines these two operations so we avoid one stat call each time we read a new or updated file. The git_futils_readbuffer functions is now a wrapper around the new function. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* refs: Cleanup reference renamingVicent Marti2011-07-061-12/+18
| | | | | | | `git_futils_rmdir_r`: rename, clean up. `git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack or things will get ugly very fast. We can reuse the same buffer.
* Remove duplicated recursive directory removal related codenulltoken2011-07-061-5/+8
|
* Fix windows specific issuesnulltoken2011-07-061-0/+2
| | | | | - msvc compilation warnings - not released file handle that prevents file removal
* fileops: add git_futils_rmdir_recurs()schu2011-07-061-0/+25
| | | | | | | git_futils_rmdir_recurs() shall remove the given directory and all subdirectories. This happens only if the directories are empty. Signed-off-by: schu <schu-github@schulog.org>
* fileops: add convenience function is_dot_or_dotdot()schu2011-07-061-7/+2
| | | | Signed-off-by: schu <schu-github@schulog.org>
* fileutils: Finish dropping the old `prettify_path`Vicent Marti2011-07-051-147/+0
|
* fileops: Fix stat() on directories for W32Vicent Marti2011-07-051-21/+10
| | | | | | | | The `stat` methods were having issues when called with a trailing slash in Windows platforms. We now use GetFileAttributes() where possible, which doesn't have this restriction.
* fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-051-28/+10
| | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* fileops: CleanupVicent Marti2011-07-051-338/+79
| | | | | | | | | | | | | | | | Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-2/+2
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* Hide ".git" directory on Windows upon creation of a non bare repositorynulltoken2011-06-291-0/+12
| | | | Directory which name starts with a dot are hidden on Linux platforms. This patch makes libgit2 behaves similarly on Windows.
* test: Properly show error messagesVicent Marti2011-06-281-4/+3
|
* gitfo_read: fix read-loopschu2011-06-201-4/+2
| | | | Signed-off-by: schu <schu-github@schulog.org>
* mingw: Fix compilationVicent Marti2011-06-181-1/+1
|
* fileops: Cast the GetProcAddress valueVicent Marti2011-06-171-3/+4
|
* fileops: Fix 'GetFinalPathNameByHandleA' in old platformsVicent Marti2011-06-171-1/+17
|
* Merge pull request #251 from nulltoken/fix/msvc-warningsVicent Martí2011-06-151-2/+3
|\ | | | | Fix compilation warnings in MSVC
| * Add mode_t definition in MSVC compat layernulltoken2011-06-151-1/+1
| |
| * Fix compilation warnings in MSVCnulltoken2011-06-121-2/+3
| |
* | blob: Fix git_blob_create_fromfile()nulltoken2011-06-151-1/+1
|/
* Use "__inline" instead of "inline" with MSVCSebastian Schuberth2011-06-101-1/+1
| | | | MSVC supports "inline" only in C++ code, not in C code.
* Prefer to use S_IFLNK instead of _S_IFLNK for consistencySebastian Schuberth2011-06-101-1/+1
|
* windows: Fix Symlink issuesVicent Marti2011-06-081-8/+131
| | | | | | | | Handle Symlinks if they can be handled in Win32. This is not even compiled. Needs review. The lstat implementation is modified from core Git. The readlink implementation is modified from PHP.
* Merge pull request #243 from jpfender/symlinks2Vicent Martí2011-06-071-0/+8
|\ | | | | Symlinks NEW
| * fileops: Allow differentiation between deep and shallow exists()Jakob Pfender2011-06-071-0/+6
| | | | | | | | | | | | | | | | | | | | When calling gitfo_exists() on a symbolic link, sometimes we need to simply check whether the link exists and sometimes we need to check whether the file pointed to by the symlink exists. Introduce a new function gitfo_shallow_exists that only checks if the link exists and revert gitfo_exists to the original functionality of checking whether the file pointed to by the link exists.
| * index/fileops: Correctly process symbolic linksJakob Pfender2011-06-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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().
* | Merge pull request #242 from schu/fix-unused-2Vicent Martí2011-06-071-7/+12
|\ \ | |/ |/| fileops.c: fix unused warning v2
| * fileops.c: fix unused warningschu2011-06-061-7/+12
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | Fileops: Fixed gitfo_mkdir_recurs so that it proprely works with a path ↵Romain Geissler2011-06-051-2/+5
|/ | | | | | without trailing slash. It used to discard the last directory if the path didn't have a trailing slash.
* Repository: Added some util functions that we'll need to discover repository ↵Romain Geissler2011-06-041-3/+3
| | | | | | | | path. retrieve_device returns the file device for a given path (so that we can detect device change while walking through parent directories). abspath returns a canonicalized path, symbolic link free. retrieive_ceiling_directories_offset returns the biggest path offset that path match in the ceiling directory list (so that we can stop at ceiling directories).
* Filebuf: Fixed a TODO in filebuf (real lock in lock_file)Romain Geissler2011-06-031-0/+14
| | | | Added gitfo_creat_locked and gitfo_creat_locked_force
* Fileops: Added gitfo_isfile.Romain Geissler2011-06-031-1/+20
| | | | | | Conflicts: src/fileops.c
* Fileops: Added a fourth argument to the path prettifying functions to use an ↵unknown2011-06-031-8/+18
| | | | | | alternate basepath. Fixed a Windows TO-DO in the prettifying functions.
* Fileops:retrieve_path_root_offset is now named ↵Romain Geissler2011-06-031-15/+15
| | | | gitfo_retrieve_path_root_offset (like other public functions). Added platform specific directory separator definition.
* gitfo_isdir: fix error messageschu2011-05-291-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* fileops: CleanupVicent Marti2011-05-231-93/+2
|
* fileops.c: Move to new error handling mechanismJakob Pfender2011-05-231-16/+18
|
* Move fileops.c to the new error handlingnulltoken2011-05-141-25/+36
|
* Improve the ODB writing backendVicent Marti2011-03-231-62/+2
| | | | | | | | | Temporary files when doing streaming writes are now stored inside the Objects folder, to prevent issues when moving files between disks/partitions. Add support for block writes to the ODB again (for those backends that cannot implement streaming).
* Fix compilation in MinGWVicent Marti2011-03-231-1/+1
|
* Fix detection of attempt to escape the root directory on Windowsnulltoken2011-03-231-5/+7
|
* Change gitfo_prettify_dir_path() and gitfo_prettify_file_path() behaviornulltoken2011-03-231-19/+41
| | | | Those functions now return prettified rooted path.
* Add failing test for issue 84nulltoken2011-03-231-0/+31
| | | | see https://github.com/libgit2/libgit2/issues#issue/84
* Fix gitfo_mv() behavior when running on Windowsnulltoken2011-03-231-1/+1
| | | | When the system temporary folder is located on a different volume than the working directory into which libgit2 is executing, MoveFileEx() requires an additional flag.