From ca30ba266c0a8b2cf110de00062847e108718923 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 24 Aug 2023 13:54:55 -0700 Subject: [PATCH] rerere: try_merge() should use LL_MERGE_ERROR when it means an error When the preimage or the postimage files cannot be read, the try_merge() helper function returns LL_MERGE_CONFLICT. To all of its callers, this does not make them do wrong things per-se, as they are only checking if the result is 0 and LL_MERGE_CONFLICT is not 0. But it is an error if we fail to read the input we expect to be able to read; return LL_MERGE_ERROR instead. This does not change any behaviour---it just makes the code use the "correct" constant to signal an error. Signed-off-by: Junio C Hamano --- rerere.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rerere.c b/rerere.c index 4ce1270a94..6bc3c54d3b 100644 --- a/rerere.c +++ b/rerere.c @@ -617,7 +617,7 @@ static int try_merge(struct index_state *istate, if (read_mmfile(&base, rerere_path(id, "preimage")) || read_mmfile(&other, rerere_path(id, "postimage"))) { - ret = LL_MERGE_CONFLICT; + ret = LL_MERGE_ERROR; } else { /* * A three-way merge. Note that this honors user-customizable