@@ -1284,6 +1284,7 @@ def function_two():
12841284 )
12851285
12861286
1287+ @pytest .mark .parametrize ("gitignore_rej" , [False , True ])
12871288@pytest .mark .parametrize (
12881289 "filename" ,
12891290 [
@@ -1297,6 +1298,7 @@ def function_two():
12971298def test_conflicted_files_are_marked_unmerged (
12981299 tmp_path_factory : pytest .TempPathFactory ,
12991300 filename : str ,
1301+ gitignore_rej : bool ,
13001302) -> None :
13011303 # Template in v1 has a file with a single line;
13021304 # in v2 it changes that line.
@@ -1325,6 +1327,17 @@ def test_conflicted_files_are_marked_unmerged(
13251327 with local .cwd (dst ):
13261328 git_init ("hello project" )
13271329
1330+ # Optionally gitignore .rej files. Inline-conflict resolution
1331+ # must still produce inline markers — the .rej is just an
1332+ # internal artifact of the resolution, never something the
1333+ # downstream user wants to see, so it's reasonable for them to
1334+ # ignore it. Regression for the case where copier's `git status
1335+ # --porcelain` invocation silently dropped ignored .rej files.
1336+ if gitignore_rej :
1337+ Path (".gitignore" ).write_text ("*.rej\n " )
1338+ git ("add" , ".gitignore" )
1339+ git ("commit" , "-m" , "ignore .rej files" )
1340+
13281341 # After first commit, change the file, commit again
13291342 Path (filename ).write_text ("upstream version 1 + downstream" )
13301343 git ("commit" , "-am" , "updated file" )
0 commit comments