From 1968ada2d36e4508ef787e57f0e5f63214bcbad7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Sep 2021 06:23:53 +0200 Subject: Merging upstream version 2.15.0. Signed-off-by: Daniel Baumann --- tests/git_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/git_test.py') diff --git a/tests/git_test.py b/tests/git_test.py index 51d5f8c..aa21880 100644 --- a/tests/git_test.py +++ b/tests/git_test.py @@ -139,6 +139,24 @@ def test_get_changed_files(in_git_dir): assert files == [] +def test_get_changed_files_disparate_histories(in_git_dir): + """in modern versions of git, `...` does not fall back to full diff""" + git_commit() + in_git_dir.join('a.txt').ensure() + cmd_output('git', 'add', '.') + git_commit() + cmd_output('git', 'branch', '-m', 'branch1') + + cmd_output('git', 'checkout', '--orphan', 'branch2') + cmd_output('git', 'rm', '-rf', '.') + in_git_dir.join('a.txt').ensure() + in_git_dir.join('b.txt').ensure() + cmd_output('git', 'add', '.') + git_commit() + + assert git.get_changed_files('branch1', 'branch2') == ['b.txt'] + + @pytest.mark.parametrize( ('s', 'expected'), ( -- cgit v1.2.3