summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-15 19:54:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-15 22:23:34 (GMT)
commit5bf29b950063c8fa2f3666cb6cf2ca20be61f3d1 (patch)
treecc5f28f70b2672d9c5cafdc2a42211e1690e0f87 /commit.h
parente1111cef23cef1d48e9e7f222db87d58c1d51ece (diff)
downloadgit-5bf29b950063c8fa2f3666cb6cf2ca20be61f3d1.zip
git-5bf29b950063c8fa2f3666cb6cf2ca20be61f3d1.tar.gz
git-5bf29b950063c8fa2f3666cb6cf2ca20be61f3d1.tar.bz2
read_sha1_file(): allow selective bypassing of replacement mechanism
The way "object replacement" mechanism was tucked to the read_sha1_file() interface was suboptimal in a couple of ways: - Callers that want it to die with useful diagnosis upon seeing a corrupt object does not have a way to say that they do not want any object replacement. - Callers who do not want it to die but want to handle the errors themselves are told to arrange to call read_object(), but the function does not use the replacement mechanism, and also it is a file scope static function that not many callers can call to begin with. This adds a read_sha1_file_extended() that takes a set of flags; the callers of read_sha1_file() passes a flag READ_SHA1_FILE_REPLACE to ask for object replacement mechanism to kick in. Later, we could add another flag bit to tell the function to return an error instead of dying and then remove the misguided "call read_object() yourself". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions