Skip to content

Commit 510651d

Browse files
committed
Fix import issue (thanks copilot!)
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 4ea73fb commit 510651d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

github/resource_github_repository_file.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,13 @@ func autoBranchDiffSuppressFunc(k, _, _ string, d *schema.ResourceData) bool {
433433
}
434434

435435
func resourceGithubRepositoryFileImport(ctx context.Context, d *schema.ResourceData, meta any) ([]*schema.ResourceData, error) {
436-
repo, filePath, branch, err := parseID3(d.Id())
436+
repo, filePathPart, branch, err := parseID3(d.Id())
437437
if err != nil {
438438
return nil, fmt.Errorf("invalid ID specified. Supplied ID must be written as <repository>:<file path>: (when branch is default) or <repository>:<file path>:<branch>. %w", err)
439439
}
440440

441+
filePath := unescapeIDPart(filePathPart)
442+
441443
client := meta.(*Owner).v3client
442444
owner := meta.(*Owner).name
443445

0 commit comments

Comments
 (0)