From 966bcc06a43b8c128b5c100b5f6f635139b48389 Mon Sep 17 00:00:00 2001 From: Tharre Date: Sun, 25 Dec 2016 03:04:09 +0100 Subject: Add test case for missing directories --- tests/t0100-redo.t | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/t0100-redo.t b/tests/t0100-redo.t index cc86d1b..a2b757f 100755 --- a/tests/t0100-redo.t +++ b/tests/t0100-redo.t @@ -34,4 +34,24 @@ test_expect_success "redo shortcuts" " redo a " +cat > "nonexistant.do" << 'EOF' +#!/bin/sh -e +redo-ifchange nonexistant2 +cat nonexistant2 > $3 +EOF + +cat > "nonexistant2.do" <<'EOF' +#!/bin/sh -e +[ -e "dir/b" ] && redo-ifchange dir/b && cat dir/b > $3 +echo "b" >> $3 +EOF + +test_expect_success "redo should succeed despite missing directories" " + mkdir dir && + echo a > dir/b && + redo nonexistant && + rm -rf dir && + redo nonexistant +" + test_done -- cgit v1.2.3-70-g09d2