1. 18 Apr, 2014 1 commit
    • config: refresh before reading a value · 523032cd
      With the isolation of complex reads, we can now try to refresh the
      on-disk file before reading a value from it.
      
      This changes the semantics a bit, as before we could be sure that a
      string we got from the configuration was valid until we wrote or
      refreshed. This is no longer the case, as a read can also invalidate the
      pointer.
      Carlos Martín Nieto committed
  2. 14 Nov, 2013 1 commit
  3. 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