From 7219b027bf6ad8ebec3c8486e730e045bd76adef Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 14 Sep 2018 09:27:49 +0100 Subject: [PATCH] resource/github_repository: Prefill auto_init during import --- github/resource_github_repository.go | 5 ++++- github/resource_github_repository_test.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 3b07d8ffba..88614b1d17 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -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{ diff --git a/github/resource_github_repository_test.go b/github/resource_github_repository_test.go index 1884a351fa..327a3787cd 100644 --- a/github/resource_github_repository_test.go +++ b/github/resource_github_repository_test.go @@ -625,6 +625,7 @@ resource "github_repository" "foo" { allow_squash_merge = false allow_rebase_merge = false has_downloads = true + auto_init = false } `, randString, randString) }