summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-19 22:05:08 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-19 22:05:08 +0200
commit5e947c91d49aacc8abb5b3f018737c72c52486a9 (patch)
tree692d72036f7f06c03571652107b9b279948e9106 /src/commit.c
parent46c84c72600c0aed379e0df659ad1ca518fdd7cb (diff)
downloadlibgit2-5e947c91d49aacc8abb5b3f018737c72c52486a9.tar.gz
index: use the checksum to check whether it's been modified
We currently use a timetamp to check whether an index file has been modified since we last read it, but this is racy. If two updates happen in the same second and we read after the first one, we won't detect the second one. Instead read the SHA-1 checksum of the file, which are its last 20 bytes which gives us a sure-fire way to detect whether the file has changed since we last read it. As we're now keeping track of it, expose an accessor to this data.
Diffstat (limited to 'src/commit.c')
0 files changed, 0 insertions, 0 deletions