mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
filter-repo: add tests for other startup errors and help option
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
30228bdde2
commit
3e4e0ed2ed
@ -717,6 +717,40 @@ test_expect_success 'startup sanity checks' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'other startup error cases and requests for help' '
|
||||
(
|
||||
git init startup_errors &&
|
||||
cd startup_errors &&
|
||||
|
||||
git filter-repo -h >out &&
|
||||
test_i18ngrep "filter-repo destructively rewrites history" out &&
|
||||
|
||||
test_must_fail git filter-repo 2>err &&
|
||||
test_i18ngrep "No arguments specified." err &&
|
||||
|
||||
test_must_fail git filter-repo --analyze 2>err &&
|
||||
test_i18ngrep "Nothing to analyze; repository is empty" err &&
|
||||
|
||||
(
|
||||
GIT_CEILING_DIRECTORIES=$(pwd) &&
|
||||
export GIT_CEILING_DIRECTORIES &&
|
||||
mkdir not_a_repo &&
|
||||
cd not_a_repo &&
|
||||
test_must_fail git filter-repo --dry-run 2>err &&
|
||||
test_i18ngrep "returned non-zero exit status" err &&
|
||||
rm err &&
|
||||
cd .. &&
|
||||
rmdir not_a_repo
|
||||
) &&
|
||||
|
||||
test_must_fail git filter-repo --analyze --path foobar 2>err &&
|
||||
test_i18ngrep ": --analyze is incompatible with --path" err &&
|
||||
|
||||
test_must_fail git filter-repo --analyze --stdin 2>err &&
|
||||
test_i18ngrep ": --analyze is incompatible with --stdin" err
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'mailmap sanity checks' '
|
||||
(
|
||||
git clone file://"$(pwd)"/analyze_me mailmap_sanity_checks &&
|
||||
|
Loading…
Reference in New Issue
Block a user