commit 5bbcb68ba919754229f995d2654e2117182bcec1 from: Stefan Sperling date: Thu May 09 19:47:46 2019 UTC add another commit test commit - bc70eb798d53bf5d6085cba45ef111c713295ed5 commit + 5bbcb68ba919754229f995d2654e2117182bcec1 blob - 30da797e1e9e3e122f6fcba9e8a20c209ca9b677 blob + a69fc89299a34873881a00b21a3b20c1af9d65a2 --- regress/cmdline/commit.sh +++ regress/cmdline/commit.sh @@ -110,6 +110,35 @@ function test_commit_subdir { test_done "$testroot" "$ret" } +function test_commit_single_file { + local testroot=`test_init commit_single_file` + + got checkout $testroot/repo $testroot/wt > /dev/null + ret="$?" + if [ "$ret" != "0" ]; then + test_done "$testroot" "$ret" + return 1 + fi + + echo "modified alpha" > $testroot/wt/alpha + echo "modified zeta" > $testroot/wt/epsilon/zeta + + (cd $testroot/wt && got commit -m 'test commit_subdir' epsilon/zeta \ + > $testroot/stdout) + + local head_rev=`git_show_head $testroot/repo` + echo "M epsilon/zeta" >> $testroot/stdout.expected + echo "created commit $head_rev" >> $testroot/stdout.expected + + cmp $testroot/stdout.expected $testroot/stdout + ret="$?" + if [ "$ret" != "0" ]; then + diff -u $testroot/stdout.expected $testroot/stdout + fi + test_done "$testroot" "$ret" +} + run_test test_commit_basic run_test test_commit_new_subdir run_test test_commit_subdir +run_test test_commit_single_file