- 12 Apr, 2017 1 commit
-
-
When the `git_futils_mmap_ro_file` function encounters an error after the file has been opened, it will do a simple returns. Instead, we should close the opened file descriptor to avoid a leak. This commit fixes the issue.
Patrick Steinhardt committed
-
- 04 Apr, 2017 1 commit
-
-
When executing `git_futils_mmap_ro_file`, we first try to guess whether the file is mmapable at all. Part of this check is whether the file is too large to be mmaped, which can be true on systems with 32 bit `size_t` types. The check is performed by first getting the file size wtih `git_futils_filesize` and then checking whether the returned size can be represented as `size_t`, returning an error if so. While this test also catches the case where the function returned an error (as `-1` is not representable by `size_t`), we will set the misleading error message "file too large to mmap". But in fact, a negative return value from `git_futils_filesize` will be caused by the inability to fstat the file. Fix the error message by handling negative return values separately and not overwriting the error message in that case.
Patrick Steinhardt committed
-
- 22 Mar, 2017 1 commit
-
-
`O_EXCL` and `O_TRUNC` are mutually exclusive flags to open(2); you can't truncate a file if you're asserting that it can't exist in the first place. Drop `O_TRUNC`.
Edward Thomson committed
-
- 09 Mar, 2017 1 commit
-
-
Don't compute the sha-1 in `git_futils_readbuffer_updated` unless the checksum was requested. This means that `git_futils_readbuffer` will not calculate the checksum unnecessarily.
Edward Thomson committed
-
- 28 Feb, 2017 4 commits
-
-
Windows doesn't support it.
Edward Thomson committed -
When fsync'ing files, fsync the parent directory in the case where we rename a file into place, or create a new file, to ensure that the directory entry is flushed correctly.
Edward Thomson committed -
Only use defaults for `git_futils_writebuffer` when flags == 0, lest (1 << 31) be treated as the defaults.
Edward Thomson committed -
Add a custom `O_FSYNC` bit (if it's not been defined by the operating system`) so that `git_futils_writebuffer` can optionally do an `fsync` when it's done writing. We call `fsync` ourselves, even on systems that define `O_FSYNC` because its definition is no guarantee of its actual support. Mac, for instance, defines it but doesn't support it in an `open(2)` call.
Edward Thomson committed
-
- 17 Feb, 2017 2 commits
-
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
- 29 Dec, 2016 1 commit
-
-
Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
Edward Thomson committed
-
- 14 Nov, 2016 1 commit
-
-
We need to save the errno, lest we clobber it in the giterr_set() call. Also add code for reporting that a path component is missing, which is a distinct failure mode.
Carlos Martín Nieto committed
-
- 04 Aug, 2016 2 commits
-
-
Since writing multiple objects may all already exist in a single packfile, avoid freshening that packfile repeatedly in a tight loop. Instead, only freshen pack files every 2 seconds.
Edward Thomson committed -
When writing an object, we calculate its OID and see if it exists in the object database. If it does, we need to freshen the file that contains it.
Edward Thomson committed
-
- 25 Feb, 2016 1 commit
-
-
Android NDK does not have a `struct timespec` in its `struct stat` for nanosecond support, instead it has a single nanosecond member inside the struct stat itself. We will use that and use a macro to expand to the `st_mtim` / `st_mtimespec` definition on other systems (much like the existing `st_mtime` backcompat definition).
Edward Thomson committed
-
- 09 Feb, 2016 1 commit
-
-
Edward Thomson committed
-
- 20 Nov, 2015 1 commit
-
-
Jacques Germishuys committed
-
- 30 Oct, 2015 2 commits
-
-
This reduces the chances of a crash in the thread tests. This shouldn't affect general usage too much, since the main usage of these functions are to read into an empty buffer.
Carlos Martín Nieto committed -
Instead of relying on the size and timestamp, which can hide changes performed in the same second, hash the file content's when we care about detecting changes.
Carlos Martín Nieto committed
-
- 02 Oct, 2015 1 commit
-
-
Axel Rasmussen committed
-
- 19 Sep, 2015 2 commits
-
-
Axel Rasmussen committed
-
Axel Rasmussen committed
-
- 17 Sep, 2015 4 commits
-
-
Edward Thomson committed
-
Edward Thomson committed
-
`git_futils_mkdir` does not blindly call `git_futils_mkdir_relative`. `git_futils_mkdir_relative` is used when you have some base directory and want to create some path inside of it, potentially removing blocking symlinks and files in the process. This is not suitable for a general recursive mkdir within the filesystem. Instead, when `mkdir` is being recursive, locate the first existent parent directory and use that as the base for `mkdir_relative`.
Edward Thomson committed -
Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter assumes that we own everything beneath the base, as if it were being called with a base of the repository or working directory, and is tailored towards checkout and ensuring that there is no bogosity beneath the base that must be cleaned up. This is (at best) slow and (at worst) unsafe in the larger context of a filesystem where we do not own things and cannot do things like unlink symlinks that are in our way.
Edward Thomson committed
-
- 17 May, 2015 1 commit
-
-
We set an error if we get an error when reading, but we don't bother setting an error message for write failing. This causes a cryptic error to be shown to the user when the target filesystem is full.
Carlos Martín Nieto committed
-
- 15 May, 2015 1 commit
-
-
Now that `git_path_direach` lets us specify an error message to report, set an appropriate error message while linking.
Carlos Martín Nieto committed
-
- 11 May, 2015 1 commit
-
-
J Wyman committed
-
- 19 Mar, 2015 1 commit
-
-
Vicent Marti committed
-
- 15 Feb, 2015 1 commit
-
-
Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
Stefan Widgren committed
-
- 13 Feb, 2015 3 commits
-
-
Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
Edward Thomson committed -
Ensure that the given length to `p_read` is of ssize_t and ensure that callers test the return as if it were an `ssize_t`.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 12 Feb, 2015 1 commit
-
-
Always do a time_t cast on st_mtime. st_mtime on Android is not the type of time_t but has the same meaning which is the number of seconds past epoch.
Leo Yang committed
-
- 05 Feb, 2015 1 commit
-
-
Don't try to strip trailing paths from the root directory on Windows (trying to create `C:` will fail).
Edward Thomson committed
-
- 04 Feb, 2015 1 commit
-
-
Edward Thomson committed
-
- 20 Jan, 2015 3 commits
-
-
On case insensitive filesystems, we may have files in the working directory that case fold to a name we want to write. Remove those files (by default) so that we will not end up with a filename that has the unexpected case.
Edward Thomson committed -
Walk up the tree to mkdir, which is less immediately efficient, but allows us to look at intermediate directories that may need attention.
Edward Thomson committed -
Checkout can now provide performance data about the number of (some) syscalls performed using an optional callback.
Edward Thomson committed
-