git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] archive: fix archive generation for empty trees

From
Brodie Rao <brodie@sf.io>
Date
Mar 9, 2012, 00:08 UTC
Message-ID
<CAJjwD-2BLYqNkb+uZqf448eFsqGEXUGuLHE3+YVi-njZGTQvuw@mail.gmail.com>
In-Reply-To
<4F58F063.4060600@lsrfire.ath.cx>

On Thu, Mar 8, 2012 at 9:46 AM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 26 quoted lines
> Am 08.03.2012 01:09, schrieb Brodie Rao:
>
>> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
>> index 527c9e7..404786f 100755
>> --- a/t/t5000-tar-tree.sh
>> +++ b/t/t5000-tar-tree.sh
>> @@ -360,4 +360,20 @@ test_expect_success GZIP 'remote tar.gz can be
>> disabled' '
>>                >remote.tar.gz
>>  '
>>
>> +test_expect_success \
>> +    'git archive with an empty tree and a prefix' \
>> +    'git rm -r .&&
>> +     git commit -m empty&&
>> +     git archive --format=tar --prefix=empty/ HEAD>  e1.tar&&
>> +     "$TAR" tf e1.tar'
>> +
>> +test_expect_success \
>> +    'git archive with an empty tree and no prefix' \
>> +    'git archive --format=tar HEAD>  e2.tar&&
>> +     test_must_fail "$TAR" tf e2.tar'
>
>
> This test fails for me, i.e. tar does not complain about the empty archive
> (GNU tar 1.25).  Perhaps use git archive -v to generate a list of entries?

Whoops. I only ran the test with BSD tar, which apparently isn't tolerant of the empty archive git-archive is generating. It'd probably be better to omit the tar invocation in that test and just confirm that git-archive doesn't blow up.

Show 11 quoted lines
>
>
>> +
>> +test_expect_success \
>> +    'git archive on specific paths with an empty tree' \
>> +    'test_must_fail git archive --format=tar --prefix=empty/ HEAD foo'
>> +
>>  test_done
>> -- 1.7.9.2
>>
>
Previous: René Scharfe
Message 9 of 9 in “archive: fix archive generation for empty trees”
  1. archive: fix archive generation for empty treesBrodie Rao, Mar 8, 2012
  2. Jeff KingMar 8, 2012
  3. Junio C HamanoMar 8, 2012
  4. Jeff KingMar 8, 2012
  5. René ScharfeMar 8, 2012
  6. Brodie RaoMar 9, 2012
  7. René ScharfeMar 9, 2012
  8. René ScharfeMar 8, 2012
  9. Brodie RaoMar 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.