- 20 Mar, 2017 1 commit
-
-
The symlink destination is always concatenated to the original path. Fix this by using `git_buf_sets` instead of `git_buf_puts`.
Sven Strickroth2 committed
-
- 28 Feb, 2017 2 commits
-
-
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 -
Edward Thomson 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
-
- 01 Jun, 2016 1 commit
-
-
Edward Thomson committed
-
- 22 Mar, 2016 1 commit
-
-
Allow setting the buffer size on open in order to use this data structure more generally as a spill buffer, with larger buffer sizes for specific use-cases.
Carlos Martín Nieto committed
-
- 11 Mar, 2016 1 commit
-
-
When writing to a file with locking not check if writing the locked file actually succeeds. Fix the issue by returning error code and message when writing fails.
Patrick Steinhardt committed
-
- 03 Nov, 2015 1 commit
-
-
When creating a filebuf, detect a directory that exists in our target file location. This prevents a failure later, when we try to move the lock file to the destination.
Edward Thomson committed
-
- 05 Sep, 2015 1 commit
-
-
We create a lockfile to update files under GIT_DIR. Sometimes these files are actually located elsewhere and a symlink takes their place. In that case we should lock and update the file at its final location rather than overwrite the symlink.
Carlos Martín Nieto committed
-
- 24 Jul, 2015 1 commit
-
-
When we have an error renaming the lockfile, we need to make sure that we remove it upon cleanup. For this, we need to keep track of whether we opened the file and whether the rename succeeded. If we did create the lockfile but the rename did not succeed, we remove the lockfile. This won't protect against all errors, but the most common ones (target file is open) does get handled.
Carlos Martín Nieto committed
-
- 11 May, 2015 1 commit
-
-
J Wyman committed
-
- 13 Feb, 2015 4 commits
-
-
Edward Thomson committed
-
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 -
Use `size_t` to hold the size of arrays to ease overflow checking, lest we check for overflow of a `size_t` then promptly truncate by packing the length into a smaller type.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 04 Jun, 2014 1 commit
-
-
When renaming a lock file to its final location, we need to make sure that it is replaced atomically. We currently have a workaround for Windows by removing the target file. This means that the target file, which may be a ref or a packfile, may cease to exist for a short wile, which shold be avoided. Implement the workaround only in Windows, by making sure that the file we want to replace is writable.
Carlos Martín Nieto committed
-
- 25 Feb, 2014 1 commit
-
-
Edward Thomson committed
-
- 05 Nov, 2013 2 commits
-
-
Edward Thomson committed
-
Edward Thomson committed
-
- 19 Aug, 2013 1 commit
-
-
Report the index being locked with its own error code in order to be able to differentiate, as a locked index is typically the result of a crashed process or concurrent access, both of which often require user intervention to fix.
Carlos Martín Nieto committed
-
- 08 Jan, 2013 1 commit
-
-
Edward Thomson committed
-
- 13 Nov, 2012 3 commits
-
-
Edward Thomson committed
-
Edward Thomson committed
-
Edward Thomson committed
-
- 30 Oct, 2012 1 commit
-
-
This adds a new API that allows users to reload the config if the file has changed on disk. A new config callback function to refresh the config was added. The modified time and file size are used to test if the file needs to be reloaded (and are now stored in the disk backend object). In writing tests, just using mtime was a problem / race, so I wanted to check file size as well. To support that, I extended `git_futils_readbuffer_updated` to optionally check file size in addition to mtime, and I added a new function `git_filebuf_stats` to fetch the mtime and size for an open filebuf (so that the config could be easily refreshed after a write). Lastly, I moved some similar file checking code for attributes into filebuf. It is still only being used for attrs, but it seems potentially reusable, so I thought I'd move it over.
Russell Belfer committed
-
- 11 Sep, 2012 1 commit
-
-
Vicent Marti committed
-
- 24 Aug, 2012 1 commit
-
-
Just clean up valgrind warnings about uninitialized memory and also clear out errno in some cases where it results in a false error message being generated at a later point.
Russell Belfer committed
-
- 02 Aug, 2012 1 commit
-
-
Vicent Marti committed
-
- 27 May, 2012 1 commit
-
-
nulltoken committed
-
- 13 Apr, 2012 1 commit
-
-
The new indexer needs to be able to bypass any kind of buffering, as it's trying to map data that it has just written to disk.
Carlos Martín Nieto committed
-
- 16 Mar, 2012 1 commit
-
-
Also cleaned up some previously converted code that still had little things to polish.
Russell Belfer committed
-
- 13 Mar, 2012 1 commit
-
-
This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
Russell Belfer committed
-
- 09 Mar, 2012 1 commit
-
-
Includes: - Proper error reporting when encountering syntax errors in a config file (file, line number, column). - Rewritten `config_write`, now with 99% less goto-spaghetti - Error state in `git_filebuf`: filebuf write functions no longer need to be checked for error returns. If any of the writes performed on a buffer fail, the last call to `git_filebuf_commit` or `git_filebuf_hash` will fail accordingly and set the appropiate error message. Baller!
Vicent Martí committed
-
- 07 Mar, 2012 1 commit
-
-
Ended up migrating a bunch of upstream functions as well including vector, attr_file, and odb in order to get this to work right.
Russell Belfer committed
-
- 05 Mar, 2012 1 commit
-
-
Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
Vicent Martí committed
-
- 24 Feb, 2012 1 commit
-
-
Making a commit that results in a blob that already exists in the ODB (i.e. committing something, then making a revert commit) will result in us trying to p_rename -> MoveFileExW a temp file into the existing ODB entry. Despite the MOVEFILE_REPLACE_EXISTING flag is passed in, Win32 does not care and fails it with STATUS_ACCESS_DENIED. To fix this, we p_unlink the ODB entry before attempting to rename it. This call will typically fail, but we don't care, we'll let the p_rename fail if the file actually does exist and we couldn't delete it for some reason (ACLs, etc).
Paul Betts committed
-
- 13 Feb, 2012 1 commit
-
-
Signed-off-by: schu <schu-github@schulog.org>
schu committed
-
- 17 Jan, 2012 1 commit
-
-
This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
Russell Belfer committed
-
- 08 Dec, 2011 1 commit
-
-
This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
Russell Belfer committed
-
- 22 Nov, 2011 1 commit
-
-
Update all stack allocations of git_filebuf to use GIT_FILEBUF_INIT and make git_filebuf_open and git_filebuf_cleanup safe to be called multiple times on the same buffer. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Russell Belfer committed
-