From 777f80d7429b0f2687cb9ff40f82b196b78384ff Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 28 Nov 2010 13:45:58 -0600 Subject: fast-import: Allow cat-blob requests at arbitrary points in stream The new rule: a "cat-blob" can be inserted wherever a comment is allowed, which means at the start of any line except in the middle of a "data" command. This saves frontends from having to loop over everything they want to commit in the next commit and cat-ing the necessary objects in advance. Signed-off-by: Jonathan Nieder Signed-off-by: David Barr Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t9300-fast-import.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 't/t9300-fast-import.sh') diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index a0162b73d9..d615d04a32 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -1823,6 +1823,72 @@ test_expect_success PIPE 'R: copy using cat-file' ' test_cmp big actual ' +test_expect_success PIPE 'R: print blob mid-commit' ' + rm -f blobs && + echo "A blob from _before_ the commit." >expect && + mkfifo blobs && + ( + exec 3 $GIT_COMMITTER_DATE + data <blobs && + test_cmp expect actual +' + +test_expect_success PIPE 'R: print staged blob within commit' ' + rm -f blobs && + echo "A blob from _within_ the commit." >expect && + mkfifo blobs && + ( + exec 3 $GIT_COMMITTER_DATE + data <blobs && + test_cmp expect actual +' + cat >input << EOF option git quiet blob -- cgit v1.2.1