I am using Team Foundation Server 2013 builds for a multi-module Gradle project, each module resides in its own Git repository. All of these repositories are located in a single TFS 2013 project. The build template is executed on the main module's repository. That is, in the build configuration, Source Settings / Repository name
is set to the main module's repository.
Now, within the build, the current commit as well as the commit ID of the last successful build is identified for each of the modules (this happens via Git shell magic and a separate repository which keeps record of the last successful builds). Then, again for each module, the TFS build activity GitAssociateCommitsAndWorkItems
is called and the values of CurrentCommit
, PreviousCommit
and RepositoryRootFolder
are set to the values which correspond with that module's repository.
After the build, the build summary on the TFS web page correctly shows the commits of all modules which took place since the last successful build, including their commit message. For the commits in the main module, the commit links correctly lead to the commit summary page within TFS and work items which have been referenced in the commit's message are associated with the build as expected. For all other modules, however, the commit links don't work, because they lead to the main module's repository instead (the link leads to something like http://my-tfs-server/tfs/MyProject/_git/mainmodule/commit/0458838c815786dfaa5fac519d1fb19699c645c5
). The association of work items doesn't work either in this case.
My question now is: How does the GitAssociateCommitsAndWorkItems
determine the TFS Git repsitory to which the commits belong and is it possible to change it?