goto Finish
}
}
+
+ // Post-commit .rec sanitizing
+ fdDep.Close()
+ if fdDepR, err := os.Open(fdDepPath); err == nil {
+ depInfo, err := depRead(fdDepR)
+ fdDepR.Close()
+ if err != nil {
+ goto Finish
+ }
+ ifchangeSeen := make(map[string]struct{}, len(depInfo.ifchanges))
+ for _, dep := range depInfo.ifchanges {
+ ifchangeSeen[dep["Target"]] = struct{}{}
+ }
+ for _, dep := range depInfo.ifcreates {
+ if _, exists := ifchangeSeen[dep]; exists {
+ tracef(CWarn, "simultaneous ifcreate and ifchange records: %s", tgt)
+ }
+ }
+ }
+
Finish:
runErr.Err = err
errs <- runErr
--- /dev/null
+#!/bin/sh
+
+testname=`basename "$0"`
+test_description="Check that warning exists when using both ifcreate/ifchange"
+. $SHARNESS_TEST_SRCDIR/sharness.sh
+export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1
+
+touch src
+echo redo-ifchange src > tgt.do
+echo redo-ifcreate src >> tgt.do
+redo tgt 2>2
+
+test_expect_success "warn exists" 'grep -q "simultaneous ifcreate and ifchange" 2'
+
+test_done