summaryrefslogtreecommitdiff
path: root/Documentation/git-shortlog.txt
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-10-17 20:23:26 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-10-18 17:07:49 (GMT)
commit3c552873c698117689af4e5159c7e491fe3a89a3 (patch)
treea5284f9fb2fbb1ab75f1ebf4a55072d414dc3b9b /Documentation/git-shortlog.txt
parentb6945f570acef7603c58d2aec4a84dce006fbd65 (diff)
downloadgit-3c552873c698117689af4e5159c7e491fe3a89a3.zip
git-3c552873c698117689af4e5159c7e491fe3a89a3.tar.gz
git-3c552873c698117689af4e5159c7e491fe3a89a3.tar.bz2
index-pack: compare only the first 20-bytes of the key.
The "union delta_base" is a strange beast. It is a 20-byte binary blob key to search a binary searchable deltas[] array, each element of which uses it to represent its base object with either a full 20-byte SHA-1 or an offset in the pack. Which representation is used is determined by another field of the deltas[] array element, obj->type, so there is no room for confusion, as long as we make sure we compare the keys for the same type only with appropriate length. The code compared the full union with memcmp(). When storing the in-pack offset, the union was first cleared before storing an unsigned long, so comparison worked fine. On 64-bit architectures, however, the union typically is 24-byte long; the code did not clear the remaining 4-byte alignment padding when storing a full 20-byte SHA-1 representation. Using memcmp() to compare the whole union was wrong. This fixes the comparison to look at the first 20-bytes of the union, regardless of the architecture. As long as ulong is smaller than 20-bytes this works fine. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Documentation/git-shortlog.txt')
0 files changed, 0 insertions, 0 deletions