Skip to content

Commit

Permalink
t6429: testcases for remembering renames
Browse files Browse the repository at this point in the history
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 <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
newren authored and gitster committed May 20, 2021
1 parent f950026 commit a22099f
Show file tree
Hide file tree
Showing 2 changed files with 700 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Documentation/technical/remembering-renames.txt
Expand Up @@ -214,12 +214,14 @@ in-memory cache of renames and thus doesn't need to be considered further.
In the special case that E->A does rename the file but also renames it to
newfile, then there is no conflict from the renaming and the merge can
succeed. In this special case, the rename is not valid to cache because
the second merge will find A:newfile in the MERGE_BASE. So a
rename/rename(1to1) needs to be specially handled by pruning renames from
the cache and decrementing the dir_rename_counts in the current and leading
directories associated with those renames. Or, since these are really
rare, one could just take the easy way out and disable the remembering
renames optimization when a rename/rename(1to1) happens.
the second merge will find A:newfile in the MERGE_BASE (see also the new
testcases in t6429 with "rename same file identically" in their
description). So a rename/rename(1to1) needs to be specially handled by
pruning renames from the cache and decrementing the dir_rename_counts in
the current and leading directories associated with those renames. Or,
since these are really rare, one could just take the easy way out and
disable the remembering renames optimization when a rename/rename(1to1)
happens.

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

0 comments on commit a22099f

Please sign in to comment.