The combine_notes_fn functions uses a non-zero return value to indicate
failure. However, this return value was converted to a call to die()
Instead, propagate this return value out to add_note(), and return it
from there to enable the caller to handle errors appropriately.
Existing add_note() callers are updated to die() upon failure, thus
preserving the current behaviour. The only exceptions are copy_note()
and notes_cache_put() where we are able to propagate the add_note()
return value instead.
This patch has been improved by the following contributions:
- Jonathan Nieder: Future-proof by always checking add_note() return value
- Jonathan Nieder: Improve clarity of final if-condition in note_tree_insert()
Thanks-to: Jonathan Nieder <email@example.com>
Signed-off-by: Johan Herland <firstname.lastname@example.org>
Signed-off-by: Junio C Hamano <email@example.com>