Branch filtering
A module can now find out which branch it runs on, and whether that branch is in the main branch of the repository. A pipeline can then do different work for each case. For example, it deploys to production from the main branch, and to a preview environment from a pull request.
New Git APIs give modules the information that they need:
GitRepository.remotesandGitRepository.remotelist the remotes of a repository.GitRepository.defaultRemotereturns the default remote: the only remote, ororigin, or the remote of the current branch.GitRef.containstells if a commit is in the history of a ref. It works for branches, tags and commits, also from a detached HEAD in CI.
The APIs use only Git concepts. They work with trunk development, and also with other workflows.