All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fix git-archive with empty trees
@ 2013-03-11  1:31 Jeff King
  2013-03-11  1:31 ` [PATCH 1/2] test-lib: factor out $GIT_UNZIP setup Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jeff King @ 2013-03-11  1:31 UTC (permalink / raw)
  To: git; +Cc: René Scharfe

I noticed that "git archive" will barf when the root tree is empty.
Instead, it should probably return an empty archive. I doubt many people
really care about this corner case in practice, but it seems like we
should handle it more gracefully (and it's an easy fix).

It came to my attention because we track failed git-archive invocations
at GitHub, and a particular repo had a two commits: adding some content,
then reverting the original commit. You can also get there with "commit
--allow-empty" on a new branch (which is what the tests do).

I didn't bother even looking at empty subtrees. AFAIK, git should never
produce them (it omits the tree entirely if there is no content in it).
You would have to fake it using hash-object manually. I suspect it would
work just fine, as we already exercise the empty-dir code paths in the
tests I did add.

  [1/2]: test-lib: factor out $GIT_UNZIP setup
  [2/2]: archive: handle commits with an empty tree

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-11  5:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11  1:31 [PATCH 0/2] fix git-archive with empty trees Jeff King
2013-03-11  1:31 ` [PATCH 1/2] test-lib: factor out $GIT_UNZIP setup Jeff King
2013-03-11  1:32 ` [PATCH 2/2] archive: handle commits with an empty tree Jeff King
2013-03-11  4:58 ` [PATCH 0/2] fix git-archive with empty trees Jeff King
2013-03-11  5:25   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.