summaryrefslogtreecommitdiff
path: root/contrib/examples/git-reset.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-05-12 04:38:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-12 18:27:50 (GMT)
commit77583e7739c76f623f49681c9ee4d10a313fe786 (patch)
tree4d4eefca31de3a963774f367c47c9fd40c6f2b41 /contrib/examples/git-reset.sh
parenteea591373e139fc8aab89a78ccb0b1512a2bf0de (diff)
downloadgit-77583e7739c76f623f49681c9ee4d10a313fe786.zip
git-77583e7739c76f623f49681c9ee4d10a313fe786.tar.gz
git-77583e7739c76f623f49681c9ee4d10a313fe786.tar.bz2
index-pack: distinguish missing objects from type errors
When we fetch a pack that does not contain an object we expected to receive, we get an error like: $ git init --bare tmp.git && cd tmp.git $ git fetch ../parent.git [...] error: Could not read 964953ec7bcc0245cb1d0db4095455edd21a2f2e fatal: Failed to traverse parents of commit b8247b40caf6704fe52736cdece6d6aae87471aa error: ../parent.git did not send all necessary objects This comes from the check_everything_connected rev-list. If we try cloning the same repo (rather than a fetch), we end up using index-pack's --check-self-contained-and-connected option instead, which produces output like: $ git clone --no-local --bare parent.git tmp.git [...] fatal: object of unexpected type fatal: index-pack failed Not only is the sha1 missing, but it's a misleading message. There's no type problem, but rather a missing object problem; we don't notice the difference because we simply compare OBJ_BAD != OBJ_BLOB. Let's provide a different message for this case: $ git clone --no-local --bare parent.git tmp.git fatal: did not receive expected object 6b00a8c61ed379d5f925a72c1987c9c52129d364 fatal: index-pack failed While we're at it, let's also improve a true type mismatch error to look like fatal: object 6b00a8c61ed379d5f925a72c1987c9c52129d364: expected type blob, got tree Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/examples/git-reset.sh')
0 files changed, 0 insertions, 0 deletions