]> git.proxmox.com Git - libgit2.git/commit - tests/checkout/crlf.c
crlf: tick the index forward to work around racy-git behaviour
authorCarlos Martín Nieto <cmn@dwim.me>
Mon, 15 Jun 2015 12:32:08 +0000 (14:32 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Tue, 16 Jun 2015 06:40:45 +0000 (08:40 +0200)
commitc4e6ab5f23819c35dc0c1a0fd7f50e5a194f0d5a
treefb858ad324aa607a9a81013c0a4066518361ba06
parent316b820b6fed712d4b6fae886ba1e6c44afc6c81
crlf: tick the index forward to work around racy-git behaviour

In order to avoid racy-git, we zero out the file size for entries with
the same timestamp as the index (or during the initial checkout). This
is the case in a couple of crlf tests, as the code is fast enough to do
everything in the same second.

As we know that we do not perform the modification just after writing
out the index, which is what this is designed to work around, tick the
mtime of the index file such that it doesn't agree with the files
anymore, and we do not zero out these entries.
src/unix/posix.h
tests/checkout/crlf.c