rename detection: don't try to detect submodule renames#4119
Merged
rename detection: don't try to detect submodule renames#4119
Conversation
added 2 commits
February 9, 2017 18:13
Test that shows that submodules are incorrectly considered in renames, and `git_merge_trees` will fail to lookup the submodule as a blob.
carlosmn
approved these changes
Feb 9, 2017
| @@ -554,7 +554,7 @@ static int similarity_measure( | |||
| *score = -1; | |||
|
|
|||
| /* don't try to compare files of different types */ | |||
Member
There was a problem hiding this comment.
This comment is now a bit out of sync, no?
51f05b5 to
191474a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider the case where some branch deletes a submodule, then adds a new submodule with a different path.
Since these two paths have the same mode, they will be eligible for rename detection, and we will try to load the blobs to analyze their contents. This will, of course, fail since not only are they not blobs but the objects are in a different repository.
Make sure that the things we're looking at are actually blobs when considering them for rename detection (in diff or merge).