From 9fb9f9e4280f0a05d103e2c5324d8de86995ac81 Mon Sep 17 00:00:00 2001 From: "Lixia (Sylvia) Lei" Date: Wed, 8 Jan 2025 18:58:55 +0800 Subject: [PATCH] minor Signed-off-by: Lixia (Sylvia) Lei --- content/file/utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/file/utils.go b/content/file/utils.go index b42f1376..43643b6d 100644 --- a/content/file/utils.go +++ b/content/file/utils.go @@ -61,6 +61,7 @@ func tarDirectory(ctx context.Context, root, prefix string, w io.Writer, removeT name = filepath.ToSlash(name) // Generate header + // NOTE: We don't support hard links and treat it as regular files var link string mode := info.Mode() if mode&os.ModeSymlink != 0 { @@ -190,7 +191,8 @@ func extractTarDirectory(dir, prefix string, r io.Reader, buf []byte) error { } case tar.TypeSymlink: var target string - if target, err = ensureLinkPath(dir, prefix, path, header.Linkname); err != nil { + target, err = ensureLinkPath(dir, prefix, path, header.Linkname) + if err != nil { return err } if _, err := os.Lstat(path); err == nil {