-
I have written this testing script: #!/bin/sh
test_description='git fixup
Testing selection of commits for git commit --fixup
'
TEST_PASSES_SANITIZE_LEAK=true
. ../sharness/sharness.sh
test_expect_success 'setup' '
git init almost-complete &&
cd almost-complete/ &&
echo "Testing file 1" >test_01.txt &&
git add test_01.txt &&
git commit -m "Commiting the first file." &&
echo "Testing file 2" >test_02.txt &&
git add test_02.txt &&
git commit -m "Commiting the second file." &&
echo "Modifying the first file." >>test_01.txt &&
git add test_01.txt &&
./git-fixup.sh --no-commit --fixup >out &&
test_grep "Commiting the first file." out
'
test_done but the result is very bad:
How does |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@mcepl it's explained in the intro on the README: the But what I do in my git tests is include a test-lib.sh file that contains the following: GIT_AUTHOR_EMAIL=author@example.com
GIT_AUTHOR_NAME='A U Thor'
GIT_COMMITTER_EMAIL=committer@example.com
GIT_COMMITTER_NAME='C O Mitter'
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME This is similar to what git.git does. That way there's no need to create a config file and git doesn't complain about not having an identity. |
Beta Was this translation helpful? Give feedback.
@mcepl it's explained in the intro on the README: the
$HOME
variable is set to a temporary directory. Git expects the configuration in~/.gitconfig
, so you can create that file with a barebones config.But what I do in my git tests is include a test-lib.sh file that contains the following:
This is similar to what git.git does. That way there's no need to create a config file and git doesn't complain about not having an identity.