author | Nicolas Pitre <nico@cam.org> | |
Tue, 15 Jul 2008 01:46:48 +0000 (21:46 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Jul 2008 06:35:32 +0000 (23:35 -0700) | ||
commit | ac9391093f54370ff3f06470e24d78b536a12327 | |
tree | 256cb6bab6ae98cb5c00017885bd658c8757ace5 | tree | snapshot |
parent | 25a1f374f0ff23a4d9191436226ab68f3da5e83a | commit | diff |
restore legacy behavior for read_sha1_file()
Since commit 8eca0b47ff1598a6d163df9358c0e0c9bd92d4c8, it is possible
for read_sha1_file() to return NULL even with existing objects when they
are corrupted. Previously a corrupted object would have terminated the
program immediately, effectively making read_sha1_file() return NULL
only when specified object is not found.
Let's restore this behavior for all users of read_sha1_file() and
provide a separate function with the ability to not terminate when
bad objects are encountered.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Since commit 8eca0b47ff1598a6d163df9358c0e0c9bd92d4c8, it is possible
for read_sha1_file() to return NULL even with existing objects when they
are corrupted. Previously a corrupted object would have terminated the
program immediately, effectively making read_sha1_file() return NULL
only when specified object is not found.
Let's restore this behavior for all users of read_sha1_file() and
provide a separate function with the ability to not terminate when
bad objects are encountered.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | diff | blob | history | |
sha1_file.c | diff | blob | history | |
t/t6011-rev-list-with-bad-commit.sh | [new file with mode: 0755] | blob |