1
votes

I have feature branch feature/feature1 and dev branch. I created a branch policy for dev branch where I have selected a build definition.

When I initiate a pull request from feature/feature1 to dev does it merge the 2 branches and then does the build? Or does it just build feature/feature1?

 * [new branch]      dev                -> origin/dev
 * [new branch]      feature/feature2   -> origin/feature/feature2
 * [new branch]      feature/test       -> origin/feature/test
 * [new branch]      master             -> origin/master
 * [new branch]      release/release-1  -> origin/release/release-1
 * [new branch]      release/release-2  -> origin/release/release-2
 * [new ref]         refs/pull/37/merge -> pull/37/merge
##[command]git checkout --progress --force refs/remotes/pull/37/merge
Note: checking out 'refs/remotes/pull/37/merge'.
2

2 Answers

5
votes

A pull request will always perform a merge into a temporary space in order to validate that the code in your source branch and the code in the target branch do not conflict. If there are merge conflicts, you will be unable to complete the pull request.

If you have a pull request validation build configured, then this temporary result of the merge will also be built. The contents of your branch are not built, only the result of the merge.

However this temporary merge result is discarded after checks run.

When you complete the pull request, your source branch will actually be merged into the target.

0
votes

with branch policies when you initiate a PR build it does the merge and then does the actual build

Real merge only happens on PR completion