In the cloud config server application.yml, if cloneOnStart is set to true, then default label is ignored and most active branch is checked out.

Spring cloud dependency version: Hoxton.SR4 Spring clould config server version: 2.2.2RELEASE

Sample application.yml

uri: ${CENTRALIZED_GIT_URI} username: ${SERVICE_USERNAME} password: ${SERVICE_PASSWORD} **cloneOnStart: true defaultLabel: qa // This is not read and most active branch is checked out **

Expected Behavior: The cloneOnStart should consider the defaultLabel so that the expected label is not checked out during first request.

Comment From: gauravhanda

If we decide to fix, this seems to be quick one. In JGitEnvironmentRepository.java :: initClonedRepository method, we need to checkout to defaultLabel if its available.

        if (null != getDefaultLabel()) {
            checkout(git, getDefaultLabel());
        }

I can submit a pull request, if someone can share the process. Sorry for trivial question, new to Spring :)

Comment From: spencergibb

https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request

Comment From: gauravhanda

Thanks @spencergibb , created PR for the same.

Comment From: spencergibb

Closing in favor of #1610