@@ -239,6 +239,60 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
239
239
})
240
240
}
241
241
242
+ func TestAccGitlabRepositoryFile_createWithExecuteFilemode (t * testing.T ) {
243
+ testProject := testAccCreateProject (t )
244
+
245
+ resource .Test (t , resource.TestCase {
246
+ PreCheck : func () { testAccRequiresAtLeast (t , "14.10" ) },
247
+ ProviderFactories : providerFactories ,
248
+ CheckDestroy : testAccCheckGitlabRepositoryFileDestroy ,
249
+ Steps : []resource.TestStep {
250
+ {
251
+ Config : fmt .Sprintf (`
252
+ resource "gitlab_repository_file" "this" {
253
+ project = %d
254
+ file_path = "meow.txt"
255
+ branch = "main"
256
+ content = "bWVvdyBtZW93IG1lb3cgbWVvdyBtZW93Cg=="
257
+ author_email = "[email protected] "
258
+ author_name = "Meow Meowington"
259
+ commit_message = "feature: change launch codes"
260
+ execute_filemode = false
261
+ }
262
+ ` , testProject .ID ),
263
+ },
264
+ // Verify Import
265
+ {
266
+ ResourceName : "gitlab_repository_file.this" ,
267
+ ImportState : true ,
268
+ ImportStateVerify : true ,
269
+ ImportStateVerifyIgnore : []string {"author_email" , "author_name" , "commit_message" },
270
+ },
271
+ {
272
+ Config : fmt .Sprintf (`
273
+ resource "gitlab_repository_file" "this" {
274
+ project = %d
275
+ file_path = "meow.txt"
276
+ branch = "main"
277
+ content = "bWVvdyBtZW93IG1lb3cgbWVvdyBtZW93Cg=="
278
+ author_email = "[email protected] "
279
+ author_name = "Meow Meowington"
280
+ commit_message = "feature: change launch codes"
281
+ execute_filemode = true
282
+ }
283
+ ` , testProject .ID ),
284
+ },
285
+ // Verify Import
286
+ {
287
+ ResourceName : "gitlab_repository_file.this" ,
288
+ ImportState : true ,
289
+ ImportStateVerify : true ,
290
+ ImportStateVerifyIgnore : []string {"author_email" , "author_name" , "commit_message" },
291
+ },
292
+ },
293
+ })
294
+ }
295
+
242
296
func testAccCheckGitlabRepositoryFileExists (n string , file * gitlab.File ) resource.TestCheckFunc {
243
297
return func (s * terraform.State ) error {
244
298
rs , ok := s .RootModule ().Resources [n ]
@@ -354,7 +408,6 @@ resource "gitlab_repository_file" "this" {
354
408
author_email = "[email protected] "
355
409
author_name = "Meow Meowington"
356
410
commit_message = "feature: change launch codes"
357
- execute_filemode = true
358
411
}
359
412
` , projectID )
360
413
}
0 commit comments