diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-08-21 23:29:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-21 23:29:11 -0700 |
commit | 5cba1229d8246da2a6d1d956eeed8227f69e185b (patch) | |
tree | 4ebb3bbc82225d157ca2f82474eb93fefe35c20d /t/test-lib.sh | |
parent | b95d0a2f8cb2923fed417e649a66c7372b968248 (diff) | |
parent | d1c3b10f7ced34a607c50de8b5c271ce9cf764ea (diff) | |
download | git-5cba1229d8246da2a6d1d956eeed8227f69e185b.tar.gz git-5cba1229d8246da2a6d1d956eeed8227f69e185b.tar.xz |
Merge branch 'mm/rebase-i-exec'
* mm/rebase-i-exec:
git-rebase--interactive.sh: use printf instead of echo to print commit message
git-rebase--interactive.sh: rework skip_unnecessary_picks
test-lib: user-friendly alternatives to test [-d|-f|-e]
rebase -i: add exec command to launch a shell command
Conflicts:
git-rebase--interactive.sh
t/t3404-rebase-interactive.sh
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 29fd7209c..3a3d4c472 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -545,6 +545,38 @@ test_external_without_stderr () { fi } +# debugging-friendly alternatives to "test [-f|-d|-e]" +# The commands test the existence or non-existence of $1. $2 can be +# given to provide a more precise diagnosis. +test_path_is_file () { + if ! [ -f "$1" ] + then + echo "File $1 doesn't exist. $*" + false + fi +} + +test_path_is_dir () { + if ! [ -d "$1" ] + then + echo "Directory $1 doesn't exist. $*" + false + fi +} + +test_path_is_missing () { + if [ -e "$1" ] + then + echo "Path exists:" + ls -ld "$1" + if [ $# -ge 1 ]; then + echo "$*" + fi + false + fi +} + + # This is not among top-level (test_expect_success | test_expect_failure) # but is a prefix that can be used in the test script, like: # |