pull/330/merge
matejcik 1 year ago committed by GitHub
commit c82912f96e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3458,7 +3458,7 @@ class RepoFilter(object):
# to the new first parent
if parents and old_1st_parent != parents[0]:
commit.file_changes = GitUtils.get_file_changes(self._repo_working_dir,
ID_TO_HASH[parents[0]],
ID_TO_HASH.get(parents[0], parents[0]),
commit.original_id)
orig_file_changes = set(commit.file_changes)
self._filter_files(commit)

@ -83,6 +83,52 @@ setup_path_rename() {
)
}
setup_unrelated_histories() {
test -d unrelated_histories && return
mkdir unrelated_histories &&
test_create_repo unrelated_histories/side-repo &&
test_create_repo unrelated_histories/test-repo &&
(
cd unrelated_histories/side-repo &&
echo 1 >test_file &&
git add test_file &&
git commit -m 1 &&
echo 2 >test_file &&
git add test_file &&
git commit -m 2 &&
git tag test_tag &&
git branch some_branch
) &&
(
cd unrelated_histories/test-repo &&
echo testing >uninteresting_file &&
git add uninteresting_file &&
git commit -m test &&
git remote add side ../side-repo &&
git fetch side &&
git fetch --tags side &&
git merge side/some_branch --allow-unrelated-histories -m "merge" &&
echo 3 >test_file &&
git add test_file &&
git commit -m 3
)
}
test_expect_success 'Commits from non-root history' '
setup_unrelated_histories &&
(
git clone file://"$(pwd)"/unrelated_histories/test-repo unrelated_histories_repo &&
cd unrelated_histories_repo &&
git filter-repo --refs test_tag..HEAD --path another_file &&
git log --format=%n --name-only | sort | uniq | grep -v "^\$" >filenames &&
test_line_count = 1 filenames
)
'
test_expect_success '--path-rename sequences/tiny:sequences/small' '
setup_path_rename &&
(

Loading…
Cancel
Save