]> git.proxmox.com Git - libgit2.git/commit - src/diff_tform.c
Fix rename detection to use actual blob size
authorRussell Belfer <rb@github.com>
Thu, 25 Jul 2013 19:27:39 +0000 (12:27 -0700)
committerRussell Belfer <rb@github.com>
Thu, 25 Jul 2013 19:27:39 +0000 (12:27 -0700)
commita16e41729d5dec4acd30302c4a217622de00d290
tree7b96eda1d029e22589321384aa5bcd94e367b693
parenteffdbeb3239b777e2b19fc4944643fc7f2a768c3
Fix rename detection to use actual blob size

The size data in the index may not reflect the actual size of the
blob data from the ODB when content filtering comes into play.
This commit fixes rename detection to use the actual blob size when
calculating data signatures instead of the value from the index.

Because of a misunderstanding on my part, I first converted the
git_index_add_bypath API to use the post-filtered blob data size
in creating the index entry.  I backed that change out, but I
kept the overall refactoring of that routine and the new internal
git_blob__create_from_paths API because it eliminates an extra
stat() call from the code that adds a file to the index.

The existing tests actually cover this code path, at least when
running on Windows, so at this point I'm not adding new tests to
cover the changes.
src/blob.c
src/blob.h
src/diff_tform.c
src/index.c