1. 10 Jun, 2018 1 commit
  2. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  3. 20 Mar, 2017 1 commit
  4. 28 Feb, 2017 2 commits
  5. 29 Dec, 2016 1 commit
  6. 01 Jun, 2016 1 commit
  7. 22 Mar, 2016 1 commit
  8. 11 Mar, 2016 1 commit
  9. 03 Nov, 2015 1 commit
  10. 05 Sep, 2015 1 commit
  11. 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
  12. 11 May, 2015 1 commit
  13. 13 Feb, 2015 4 commits
  14. 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
  15. 25 Feb, 2014 1 commit
  16. 05 Nov, 2013 2 commits
  17. 19 Aug, 2013 1 commit
  18. 08 Jan, 2013 1 commit
  19. 13 Nov, 2012 3 commits
  20. 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
  21. 11 Sep, 2012 1 commit
  22. 24 Aug, 2012 1 commit
  23. 02 Aug, 2012 1 commit
  24. 27 May, 2012 1 commit
  25. 13 Apr, 2012 1 commit
  26. 16 Mar, 2012 1 commit
  27. 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
  28. 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
  29. 07 Mar, 2012 1 commit
  30. 05 Mar, 2012 1 commit
  31. 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
  32. 13 Feb, 2012 1 commit
  33. 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