Skip to content

Commit 6fd0f02

Browse files
committed
fast-export: re-define expectation with "no-exact refs"
In 25e0ca5 (Add new fast-export testcases, 2009-06-25), we introduced a test where `fast-export` was called with a commit range whose positive side was not a ref name, but a revision that refers to the parent of a ref. In such a case, the result of `fast-export` cannot be piped to `fast-import` to essentially recreate the same revisions because we do not have a proper ref name to work with. The introduced test case set the expectation that Git should transmogrify the `main~1` into `refs/heads/master`, and because it doesn't, the test case was marked as demonstrating a breakage. However, it would be improper to perform that conversion: the overall expectation of `fast-export` is that when piping it to `fast-import`, you get an identical result. And no matter how you hold the tool, `git fast-export main~2..main~1` will never be able to perform that trick because there is simply insufficient information. It would seem that `fast-export` Does The Right Thing here by using `main~1` as the "ref name", even if `fast-import` would stumble over that: At least the output documents properly which commit was exported, even if the result is not a valid `fast-import` script. So let's turn the test case around into documenting that the current behavior is actually expected and not at all a breakage that needs fixing. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent fd65da7 commit 6fd0f02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t9350-fast-export.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,7 @@ mark :2
470470
data 3
471471
hi
472472
473-
reset refs/heads/main
474-
commit refs/heads/main
473+
commit main~1
475474
mark :3
476475
author A U Thor <[email protected]> 1112912713 -0700
477476
committer C O Mitter <[email protected]> 1112912713 -0700
@@ -482,7 +481,7 @@ M 100644 :2 there
482481
483482
EOF
484483

485-
test_expect_failure 'no exact-ref revisions included' '
484+
test_expect_success 'no exact-ref revisions included' '
486485
(
487486
cd limit-by-paths &&
488487
git fast-export main~2..main~1 > output &&

0 commit comments

Comments
 (0)