pull/31352/merge
Arne Georg Gisnås Gleditsch 12 months ago committed by GitHub
commit d38db82d0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -233,6 +233,7 @@ func writeToTar(out *tar.Writer, name string, body []byte) error {
Mode: 0644, Mode: 0644,
Size: int64(len(body)), Size: int64(len(body)),
ModTime: time.Now(), ModTime: time.Now(),
Format: tar.FormatPAX,
} }
if err := out.WriteHeader(h); err != nil { if err := out.WriteHeader(h); err != nil {
return err return err

@ -137,10 +137,7 @@ func Indent(n int, text string) string {
} }
func TestSavePreservesTimestamps(t *testing.T) { func TestSavePreservesTimestamps(t *testing.T) {
// Test executes so quickly that if we don't subtract a second, the initialCreateTime := time.Now()
// check will fail because `initialCreateTime` will be identical to the
// written timestamp for the files.
initialCreateTime := time.Now().Add(-1 * time.Second)
tmp := t.TempDir() tmp := t.TempDir()

@ -245,6 +245,7 @@ func writeToTar(out *tar.Writer, name string, body []byte) error {
Mode: 0644, Mode: 0644,
Size: int64(len(body)), Size: int64(len(body)),
ModTime: time.Now(), ModTime: time.Now(),
Format: tar.FormatPAX,
} }
if err := out.WriteHeader(h); err != nil { if err := out.WriteHeader(h); err != nil {
return err return err

@ -140,10 +140,7 @@ func Indent(n int, text string) string {
} }
func TestSavePreservesTimestamps(t *testing.T) { func TestSavePreservesTimestamps(t *testing.T) {
// Test executes so quickly that if we don't subtract a second, the initialCreateTime := time.Now()
// check will fail because `initialCreateTime` will be identical to the
// written timestamp for the files.
initialCreateTime := time.Now().Add(-1 * time.Second)
tmp := t.TempDir() tmp := t.TempDir()

Loading…
Cancel
Save