Skip to content

Commit f0f5c37

Browse files
authored
Exporter: omit git_provider only for well-known Git URLs (#3216)
The `git_provider` field is marked as `computed` because we're detecting it for well-known Git providers (GitHub, Azure DevOps, ...). But because of this it was omitted from the generated code even for other Git providers. This PR fixes this issue.
1 parent 2dd4f7c commit f0f5c37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exporter/importables.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,10 @@ var resourcesMap map[string]importable = map[string]importable{
13171317
return d.Get("branch").(string) == ""
13181318
case "tag":
13191319
return d.Get("tag").(string) == ""
1320+
case "git_provider":
1321+
url := d.Get("url").(string)
1322+
provider := repos.GetGitProviderFromUrl(url)
1323+
return provider != "" // omit git_provider only for well-known URLs
13201324
}
13211325
return defaultShouldOmitFieldFunc(ic, pathString, as, d)
13221326
},

0 commit comments

Comments
 (0)