tar-tree: Introduce write_entry()
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>
Sat, 25 Mar 2006 22:21:03 +0000 (23:21 +0100)
committerJunio C Hamano <junkio@cox.net>
Sun, 26 Mar 2006 00:35:43 +0000 (16:35 -0800)
... and use it initially to write global extended header records.
Improvements compared to the old write_header():

  - Uses a struct ustar_header instead of hardcoded offsets.
  - Takes one struct strbuf as path argument instead of a (basedir,
    prefix, name) tuple.
  - Not only writes the tar header, but also the contents of the
    file, if any.
  - Does not write directly into the ring buffer.  This allows the
    code to be layed out more naturally, because there is no more
    ordering constraint.  Before we had to first finish writing the
    extended header, now we can construct the extended and normal
    headers in parallel.
  - The typeflag parameter has been replaced by (reasonable) magic
    values.  path == NULL indicates an extended header, additionally
    sha1 == NULL means it is a global extended header.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>

No differences found