Commit graph

2 commits

Author SHA1 Message Date
Elia Pinto
46efd28be1 kset.h, tar.h: add missing header guard to prevent multiple inclusion
Add missing headers to prevent ill-effects from multiple inclusion.

Found by the LGTM source code analyzer.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-07 20:12:04 +09:00
Rene Scharfe
ae64bbc18c tar-tree: Introduce write_entry()
... 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>
2006-03-25 16:35:43 -08:00