container/initmkdir: check path equivalence by value

Fixes regression introduced while integrating Absolute.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-20 02:32:22 +09:00
parent e463faf649
commit 66f52407d3
2 changed files with 30 additions and 1 deletions

View File

@@ -29,6 +29,12 @@ func (m *MkdirOp) apply(*setupState) error {
return wrapErrSelf(os.MkdirAll(toSysroot(m.Path.String()), m.Perm))
}
func (m *MkdirOp) Is(op Op) bool { vm, ok := op.(*MkdirOp); return ok && m == vm }
func (m *MkdirOp) Is(op Op) bool {
vm, ok := op.(*MkdirOp)
return ok && ((m == nil && vm == nil) || (m != nil && vm != nil &&
m.Path != nil && vm.Path != nil &&
m.Path.String() == vm.Path.String() &&
m.Perm == vm.Perm))
}
func (*MkdirOp) prefix() string { return "creating" }
func (m *MkdirOp) String() string { return fmt.Sprintf("directory %q perm %s", m.Path, m.Perm) }