Skip to content

Commit

Permalink
Merge pull request #154 from terraform-providers/b-import-repo-auto-init
Browse files Browse the repository at this point in the history
resource/github_repository: Prefill auto_init during import
  • Loading branch information
radeksimko authored Sep 14, 2018
2 parents bc882ec + 4f97eb5 commit ea4f6ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ func resourceGithubRepository() *schema.Resource {
Update: resourceGithubRepositoryUpdate,
Delete: resourceGithubRepositoryDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
d.Set("auto_init", false)
return []*schema.ResourceData{d}, nil
},
},

Schema: map[string]*schema.Schema{
Expand Down
1 change: 1 addition & 0 deletions github/resource_github_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ resource "github_repository" "foo" {
allow_squash_merge = false
allow_rebase_merge = false
has_downloads = true
auto_init = false
}
`, randString, randString)
}
Expand Down

0 comments on commit ea4f6ad

Please sign in to comment.