}
// Was $1 touched?
+ if fd, err := os.Open(path.Join(cwdOrig, tgt)); err == nil {
+ errTouched := errors.New("$1 was explicitly touched")
+ if inodePrev == nil {
+ fd.Close()
+ runErr.Err = errTouched
+ errs <- runErr
+ return
+ } else {
+ inode, err := inodeFromFile(fd)
+ fd.Close()
+ if err != nil {
+ runErr.Err = err
+ errs <- runErr
+ return
+ }
+ if !inode.Equals(inodePrev) {
+ runErr.Err = errTouched
+ errs <- runErr
+ return
+ }
+ }
+ }
+
if inodePrev != nil {
if fd, err := os.Open(path.Join(cwdOrig, tgt)); err == nil {
inode, err := inodeFromFile(fd)
--- /dev/null
+#!/bin/sh
+
+testname=`basename "$0"`
+test_description="Check failing if unexistent \$1 is touched"
+. $SHARNESS_TEST_SRCDIR/sharness.sh
+export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1
+
+echo touch \$1 > foo.do
+test_expect_success "it fails" 'redo foo ; [ $? = 1 ]'
+
+test_done