diff options
author | Russell Belfer <rb@github.com> | 2014-04-28 14:48:41 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:33 -0700 |
commit | 94fb4aadc80c927a59696dc01db03f3a0629dae7 (patch) | |
tree | c01ad832b1656dcaf9d7e246ae9c3a58586fd838 /src/checkout.c | |
parent | 0fc8e1f6bd9a5148d3a262142e9a70126f5c3a42 (diff) | |
download | libgit2-94fb4aadc80c927a59696dc01db03f3a0629dae7.tar.gz |
Add diff option to update index stat cache
When diff is scanning the working directory, if it finds a file
where it is not sure if the index entry matches the working dir,
it will recalculate the OID (which is pretty expensive). This
adds a new flag to diff so that if the OID calculation finds that
the file actually has not changed (i.e. just the modified time was
altered or such), then it will refresh the stat cache in the index
so that future calls to diff will not have to check the oid again.
Diffstat (limited to 'src/checkout.c')
-rw-r--r-- | src/checkout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c index d94cb0c7d..727911694 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -184,7 +184,7 @@ static bool checkout_is_workdir_modified( if (baseitem->size && wditem->file_size != baseitem->size) return true; - if (git_diff__oid_for_entry(&oid, data->diff, wditem) < 0) + if (git_diff__oid_for_entry(&oid, data->diff, wditem, NULL) < 0) return false; return (git_oid__cmp(&baseitem->id, &oid) != 0); |