1. 20 Mar, 2017 1 commit
  2. 28 Feb, 2017 2 commits
  3. 29 Dec, 2016 1 commit
  4. 01 Jun, 2016 1 commit
  5. 22 Mar, 2016 1 commit
  6. 11 Mar, 2016 1 commit
  7. 03 Nov, 2015 1 commit
  8. 05 Sep, 2015 1 commit
  9. 24 Jul, 2015 1 commit
    • filebuf: remove lockfile upon rename errors · 19d9beb7
      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
  10. 11 May, 2015 1 commit
  11. 13 Feb, 2015 4 commits
  12. 04 Jun, 2014 1 commit
    • filebuf: make unlocking atomic · e58281aa
      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
  13. 25 Feb, 2014 1 commit
  14. 05 Nov, 2013 2 commits
  15. 19 Aug, 2013 1 commit
  16. 08 Jan, 2013 1 commit
  17. 13 Nov, 2012 3 commits
  18. 30 Oct, 2012 1 commit
    • Add git_config_refresh() API to reload config · 744cc03e
      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
  19. 11 Sep, 2012 1 commit
  20. 24 Aug, 2012 1 commit
  21. 02 Aug, 2012 1 commit
  22. 27 May, 2012 1 commit
  23. 13 Apr, 2012 1 commit
  24. 16 Mar, 2012 1 commit
  25. 13 Mar, 2012 1 commit
    • Migrate ODB files to new error handling · e1de726c
      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
  26. 09 Mar, 2012 1 commit
    • error-handling: On-disk config file backend · dda708e7
      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
  27. 07 Mar, 2012 1 commit
  28. 05 Mar, 2012 1 commit
  29. 24 Feb, 2012 1 commit
    • Ensure that commits don't fail if committing content that already exists · 1db9d2c3
      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
  30. 13 Feb, 2012 1 commit
  31. 17 Jan, 2012 1 commit
    • Move path related functions from fileops to path · 1744fafe
      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
  32. 08 Dec, 2011 1 commit
    • Use git_buf for path storage instead of stack-based buffers · 97769280
      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
  33. 22 Nov, 2011 1 commit