Skip to content

@saflib/git


Function: isAncestor()

isAncestor(repoRoot, maybeAncestor, maybeDescendant): ReturnsError<boolean, GitCommandError>>

True when maybeAncestor is an ancestor of maybeDescendant (or they are the same commit). Wraps git merge-base --is-ancestor.

Parameters

ParameterType
repoRootstring
maybeAncestorstring
maybeDescendantstring

Returns

ReturnsError<boolean, GitCommandError>