upload-pack: fix off-by-one depth calculation in shallow clone
commit682c7d2f1a2d1a5443777237450505738af2ff1a
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 11 Jan 2013 09:05:47 +0000 (11 16:05 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Jan 2013 17:10:57 +0000 (11 09:10 -0800)
tree785facb77381b9324babbb32438295369f531456
parent4dcb167fc3536db0e78c50f239cd3a19afd383fa
upload-pack: fix off-by-one depth calculation in shallow clone

get_shallow_commits() is used to determine the cut points at a given
depth (i.e. the number of commits in a chain that the user likes to
get). However we count current depth up to the commit "commit" but we
do the cutting at its parents (i.e. current depth + 1). This makes
upload-pack always return one commit more than requested. This patch
fixes it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
shallow.c
t/t5500-fetch-pack.sh