]> Cypherpunks.ru repositories - goredo.git/blobdiff - t/goredo-chmoding.t
Chmod even if not renamed
[goredo.git] / t / goredo-chmoding.t
diff --git a/t/goredo-chmoding.t b/t/goredo-chmoding.t
new file mode 100755 (executable)
index 0000000..7986697
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+testname=`basename "$0"`
+test_description="Check that non-renamed target copies mode from temporary target"
+. $SHARNESS_TEST_SRCDIR/sharness.sh
+export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1
+
+echo echo ok > foo.do
+redo foo
+test_expect_success "foo is non executable" '[ ! -x foo ]'
+inode0=`stat -f %i foo`
+
+cat > foo.do <<EOF
+echo ok > \$3
+chmod +x \$3
+EOF
+redo foo
+test_expect_success "foo is executable" '[ -x foo ]'
+inode1=`stat -f %i foo`
+test_expect_success "foo was not renamed" '[ $inode0 = $inode1 ]'
+
+test_done