test_expect_success \
"using paths with --interactive" \
"echo bong-o-bong >file &&
- ! echo 7 | git-commit -m foo --interactive file"
+ ! (echo 7 | git-commit -m foo --interactive file)"
test_expect_success \
"using invalid commit with -C" \
cat >editor <<\EOF
#!/bin/sh
-sed -e "s/a file/an amend commit/g" < $1 > $1-
-mv $1- $1
+sed -e "s/a file/an amend commit/g" < "$1" > "$1-"
+mv "$1-" "$1"
EOF
chmod 755 editor
cat >editor <<\EOF
#!/bin/sh
-sed -e "s/amend/older/g" < $1 > $1-
-mv $1- $1
+sed -e "s/amend/older/g" < "$1" > "$1-"
+mv "$1-" "$1"
EOF
chmod 755 editor
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
- diff -u expected actual
+ test_cmp expected actual
'
git var GIT_COMMITTER_IDENT |
sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
) >expected &&
- diff -u expected actual
+ test_cmp expected actual
'
echo
echo three
) >expected &&
- diff -u expected actual
+ test_cmp expected actual
'
git merge -s ours side -m "empty ok" &&
git diff HEAD^ HEAD >actual &&
: >expected &&
- diff -u expected actual &&
+ test_cmp expected actual &&
git commit --amend -m "empty really ok" &&
git diff HEAD^ HEAD >actual &&
: >expected &&
- diff -u expected actual
+ test_cmp expected actual
'
git commit --allow-empty --amend -C "$old" &&
git show --pretty="format:%ad %s" "$old" >expected &&
git show --pretty="format:%ad %s" HEAD >actual &&
- diff -u expected actual
+ test_cmp expected actual
'
git commit --allow-empty --amend -C tagged-old &&
git show --pretty="format:%ad %s" "$old" >expected &&
git show --pretty="format:%ad %s" HEAD >actual &&
- diff -u expected actual
+ test_cmp expected actual
'