-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the default_branch as the name of an initialized branch instead of defaulting to master #89
Conversation
Hi @jamiemccrindle Thanks for opening this PR. I try update the repository |
Oh dang. I’ll test further. Can you send me the tf that broke?
|
@jamiemccrindle
TF config: resource "azuredevops_project" "project" {
project_name = "Sample Project"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
}
resource "azuredevops_git_repository" "repo" {
project_id = azuredevops_project.project.id
name = "Sample Empty Git Repository"
initialization {
init_type = "Clean"
}
default_branch="refs/heads/master"
} |
Thank you! Testing now. I suspect that this may have broken before too i.e. the initalization only happens once and the default branch needs the branch to exist but will confirm. |
Set |
@xuzhang3, have confirmed that this would also break in trunk i.e. changing the default branch after creation to a branch that doesn't exist. If adding |
@xuzhang3 @jamiemccrindle Could one of you create an issue for the bug you discovered? 😛 |
hi @EliiseS, is it the one for a change of the |
The change of the default_branch setting failing on update if the branch doesn't exist @jamiemccrindle :) |
re: raising an issue for the what's arguably more interesting is that the |
@jamiemccrindle If you set |
@jamiemccrindle LGTM, thanks for your contribute. |
All Submissions:
What about the current behavior has changed?
Currently if you initialize a repo, it will always create a 'master' branch. If you specify a 'default_branch' that isn't master, setting the default branch will fail. This change means that the value of 'default_branch' is used as the branch name on initialization e.g. if you wanted the branch to be called 'refs/heads/main'. Note: this only changes the behaviour for 'Clean' initialization type. For uninitialized, there won't be a branch to set.
Issue Number: No issue
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
This does change the behavior in that 'default_branch' now works when initializing repos where previously it didn't.
Any relevant logs, error output, etc?
n/a
Other information
No component changes.