Skip to content

Commit

Permalink
Fix "crane layout gc" failing on Windows wit "Error: cannot parse has…
Browse files Browse the repository at this point in the history
…h: "sha256\\0401ae60059.." (#1942)
  • Loading branch information
bartoszpop committed May 8, 2024
1 parent ff385a9 commit 0cdbd1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/v1/layout/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package layout
import (
"fmt"
"io/fs"
"os"
"path/filepath"
"strings"

Expand Down Expand Up @@ -54,7 +55,7 @@ func (l Path) GarbageCollect() ([]v1.Hash, error) {
if err != nil {
return err
}
hashString := strings.Replace(rel, "/", ":", 1)
hashString := strings.Replace(rel, string(os.PathSeparator), ":", 1)
if present := blobsToKeep[hashString]; !present {
h, err := v1.NewHash(hashString)
if err != nil {
Expand Down

0 comments on commit 0cdbd1d

Please sign in to comment.