Skip to content

Commit a22099f

Browse files
newrengitster
authored andcommitted
t6429: testcases for remembering renames
We will soon be adding an optimization that caches (in memory only, never written to disk) upstream renames during a sequence of merges such as occurs during a cherry-pick or rebase operation. Add several tests meant to stress such an implementation to ensure it does the right thing, and include a test whose outcome we will later change due to this optimization as well. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f950026 commit a22099f

File tree

2 files changed

+700
-6
lines changed

2 files changed

+700
-6
lines changed

Documentation/technical/remembering-renames.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ in-memory cache of renames and thus doesn't need to be considered further.
214214
In the special case that E->A does rename the file but also renames it to
215215
newfile, then there is no conflict from the renaming and the merge can
216216
succeed. In this special case, the rename is not valid to cache because
217-
the second merge will find A:newfile in the MERGE_BASE. So a
218-
rename/rename(1to1) needs to be specially handled by pruning renames from
219-
the cache and decrementing the dir_rename_counts in the current and leading
220-
directories associated with those renames. Or, since these are really
221-
rare, one could just take the easy way out and disable the remembering
222-
renames optimization when a rename/rename(1to1) happens.
217+
the second merge will find A:newfile in the MERGE_BASE (see also the new
218+
testcases in t6429 with "rename same file identically" in their
219+
description). So a rename/rename(1to1) needs to be specially handled by
220+
pruning renames from the cache and decrementing the dir_rename_counts in
221+
the current and leading directories associated with those renames. Or,
222+
since these are really rare, one could just take the easy way out and
223+
disable the remembering renames optimization when a rename/rename(1to1)
224+
happens.
223225

224226
The previous paragraph handled the cases for E->A renaming oldfile, let's
225227
continue assuming that oldfile is not renamed in A.

0 commit comments

Comments
 (0)