Skip to content
  • Johannes Schindelin's avatar
    commit-reach(repo_in_merge_bases_many): report missing commits · 24876ebf
    Johannes Schindelin authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Some functions in Git's source code follow the convention that returning
    a negative value indicates a fatal error, e.g. repository corruption.
    
    Let's use this convention in `repo_in_merge_bases()` to report when one
    of the specified commits is missing (i.e. when `repo_parse_commit()`
    reports an error).
    
    Also adjust the callers of `repo_in_merge_bases()` to handle such
    negative return values.
    
    Note: As of this patch, errors are returned only if any of the specified
    merge heads is missing. Over the course of the next patches, missing
    commits will also be reported by the `paint_down_to_common()` function,
    which is called by `repo_in_merge_bases_many()`, and those errors will
    be properly propagated back to the caller at that stage.
    
    Signed-off-by: default avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    24876ebf