1. 16 Jun, 2015 2 commits
    • index: zero the size of racily-clean entries · 316b820b
      If a file entry has the same timestamp as the index itself, it is
      considered racily-clean, as it may have been modified after the index
      was written, but during the same second. We take extra steps to check
      the contents, but this is just one part of avoiding races.
      
      For files which do have changes but have not been updated in the index,
      updating the on-disk index means updating its timestamp, which means we
      would no longer recognise these entries as racy and we would trust the
      timestamp to tell us whether they have changed.
      
      In order to work around this, git zeroes out the file-size field in
      entries with the same timestamp as the index in order to force the next
      diff to check the contents. Do so in libgit2 as well.
      Carlos Martín Nieto committed
    • diff: add failing test for racy-git in the index · 77596fcf
      We update the index and then immediately change the contents of the
      file. This makes the diff think there are no changes, as the timestamp
      of the file agrees with the cached data. This is however a bug, as the
      file has obviously changed contents.
      
      The test is a bit fragile, as it assumes that the index writing and the
      following modification of the file happen in the same second, but it's
      enough to show the issue.
      Carlos Martín Nieto committed
  2. 15 Jun, 2015 7 commits
  3. 12 Jun, 2015 15 commits
  4. 11 Jun, 2015 3 commits
  5. 10 Jun, 2015 13 commits