Explorar o código

fix Path corruption in 'docker diff'

Victor Vieux %!s(int64=12) %!d(string=hai) anos
pai
achega
e16c93486d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      changes.go

+ 1 - 1
changes.go

@@ -65,7 +65,7 @@ func Changes(layers []string, rw string) ([]Change, error) {
 		file := filepath.Base(path)
 		// If there is a whiteout, then the file was removed
 		if strings.HasPrefix(file, ".wh.") {
-			originalFile := strings.TrimLeft(file, ".wh.")
+			originalFile := strings.TrimPrefix(file, ".wh.")
 			change.Path = filepath.Join(filepath.Dir(path), originalFile)
 			change.Kind = ChangeDelete
 		} else {