Skip to content

Commit 102f8c5

Browse files
author
Bartosz Popiela
committed
Fix "crane layout gc" failing on Windows wit "Error: cannot parse hash: "sha256\\0401ae60059.." (google#1942)
1 parent ff385a9 commit 102f8c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/v1/layout/gc.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package layout
1818
import (
1919
"fmt"
2020
"io/fs"
21+
"os"
2122
"path/filepath"
2223
"strings"
2324

@@ -54,7 +55,7 @@ func (l Path) GarbageCollect() ([]v1.Hash, error) {
5455
if err != nil {
5556
return err
5657
}
57-
hashString := strings.Replace(rel, "/", ":", 1)
58+
hashString := strings.Replace(rel, string(os.PathSeparator), ":", 1)
5859
if present := blobsToKeep[hashString]; !present {
5960
h, err := v1.NewHash(hashString)
6061
if err != nil {

0 commit comments

Comments
 (0)