Jeff King <peff@xxxxxxxx> writes: > ... On > the other hand, branch->merge_name _does_ have one element, so perhaps > it is an error in the caller to assume that branch->merge_nr and > branch->merge necessarily correspond. I think this is a sensible thing to do. branch_has_merge_config() could be used here but I do not see a point, as the code already knows branch is non NULL and there are many other places that checks !!branch->merge themselves. It may be worth adding a helper function that a caller can lazily sanity check the set of configuration around a given branch, but that sanity check will probably go way beyond what branch_has_merge_config() currently does, so I would think that would be a separate patch after somebody audits what current non-users of branch_has_merge_config() want. For example, builtin-branch.c not only makes sure branch->merge is non NULL but also wants branch->merge[0] and branch->merge[0]->dst exists, and encapsulating only the first two out of four checks it does by using branch_has_merge_config() does not add much value to it.. Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html