]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7501-commit.sh
Merge branch 'tr/gcov'
[git.git] / t / t7501-commit.sh
index 63bfc6d8b3f6917cad1b51a73a84ba61762b220d..b4e2b4db8421c24cb714fcad7cd6ec00ea88c016 100755 (executable)
@@ -127,6 +127,26 @@ test_expect_success \
        "showing committed revisions" \
        "git rev-list HEAD >current"
 
+cat >editor <<\EOF
+#!/bin/sh
+sed -e "s/good/bad/g" < "$1" > "$1-"
+mv "$1-" "$1"
+EOF
+chmod 755 editor
+
+cat >msg <<EOF
+A good commit message.
+EOF
+
+test_expect_success \
+       'editor not invoked if -F is given' '
+        echo "moo" >file &&
+        VISUAL=./editor git commit -a -F msg &&
+        git show -s --pretty=format:"%s" | grep -q good &&
+        echo "quack" >file &&
+        echo "Another good message." | VISUAL=./editor git commit -a -F - &&
+        git show -s --pretty=format:"%s" | grep -q good
+        '
 # We could just check the head sha1, but checking each commit makes it
 # easier to isolate bugs.