diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index 28a4dd18d..269386523 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -58,7 +58,7 @@ func (cmd CmdMount) Execute(args []string) error { mountpoint := args[0] if _, err := os.Stat(mountpoint); err != nil { if os.IsNotExist(err) { - cmd.global.Verbosef("Mountpoint [%s] doesn't exist, creating it\n", mountpoint) + cmd.global.Verbosef("Mountpoint %s doesn't exist, creating it\n", mountpoint) err = os.Mkdir(mountpoint, os.ModeDir|0755) if err != nil { return err diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go index b6e814009..9a08cd932 100644 --- a/cmd/restic/integration_test.go +++ b/cmd/restic/integration_test.go @@ -519,7 +519,9 @@ func TestMount(t *testing.T) { mountpoint, err := ioutil.TempDir(TestTempDir, "restic-test-mount-") OK(t, err) - defer OK(t, os.RemoveAll(mountpoint)) + + // We remove the mountpoint now to check that cmdMount creates it + OK(t, os.RemoveAll(mountpoint)) ready := make(chan struct{}, 1) go cmdMount(t, global, mountpoint, ready)