diff options
author | Elijah Newren <newren@gmail.com> | 2009-03-25 17:53:23 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-25 22:53:45 -0700 |
commit | ebeec7dbc564cb83edd8faee87890c47b6f0da43 (patch) | |
tree | 986ed08fb1a44f558826a0e7a8efbcb55b68220d /t | |
parent | 4fa535a179e771cd5a16d5ab05e97e7bb52739ef (diff) | |
download | git-ebeec7dbc564cb83edd8faee87890c47b6f0da43.tar.gz git-ebeec7dbc564cb83edd8faee87890c47b6f0da43.tar.xz |
fast-export: Avoid dropping files from commits
When exporting a subset of commits on a branch that do not go back to a
root commit (e.g. master~2..master), we still want each exported commit to
have the same files in the exported tree as in the original tree.
Previously, when given such a range, we would omit master~2 as a parent of
master~1, but we would still diff against master~2 when selecting the list
of files to include in master~1. This would result in only files that
had changed in the given range showing up in the resulting export. In such
cases, we should diff master~1 against the root instead (i.e. use
diff_root_tree_sha1 instead of diff_tree_sha1).
There's a special case to consider here: incremental exports (i.e. exports
where the --import-marks flag is specified). If master~2 is an imported
mark, then we still want to diff master~1 against master~2 when selecting
the list of files to include.
We can handle all cases, including the special case, by just checking
whether master~2 corresponds to a known object mark when deciding what to
diff against.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t9301-fast-export.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh index 86c376088..b860626be 100755 --- a/t/t9301-fast-export.sh +++ b/t/t9301-fast-export.sh @@ -8,6 +8,9 @@ test_description='git fast-export' test_expect_success 'setup' ' + echo break it > file0 && + git add file0 && + test_tick && echo Wohlauf > file && git add file && test_tick && @@ -57,8 +60,8 @@ test_expect_success 'fast-export master~2..master' ' (cd new && git fast-import && test $MASTER != $(git rev-parse --verify refs/heads/partial) && - git diff master..partial && - git diff master^..partial^ && + git diff --exit-code master partial && + git diff --exit-code master^ partial^ && test_must_fail git rev-parse partial~2) ' |