mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-12 21:22:39 +02:00
38 lines
813 B
Bash
Executable File
38 lines
813 B
Bash
Executable File
#!/bin/bash
|
|
|
|
test_description='Basic filter-repo tests'
|
|
|
|
. ./test-lib.sh
|
|
|
|
export PATH=$(dirname $TEST_DIRECTORY):$PATH # Put git-filter-repo in PATH
|
|
|
|
DATA="$TEST_DIRECTORY/t9390"
|
|
|
|
filter_testcase() {
|
|
INPUT=$1
|
|
OUTPUT=$2
|
|
shift 2
|
|
REST=("$@")
|
|
|
|
|
|
NAME="check: $INPUT -> $OUTPUT using '${REST[@]}'"
|
|
test_expect_success "$NAME" '
|
|
# Clean up from previous run
|
|
git pack-refs --all &&
|
|
rm .git/packed-refs &&
|
|
|
|
# Run the example
|
|
cat $DATA/$INPUT | git filter-repo --stdin --quiet --force ${REST[@]} &&
|
|
|
|
# Compare the resulting repo to expected value
|
|
git fast-export --use-done-feature --all >compare &&
|
|
test_cmp $DATA/$OUTPUT compare
|
|
'
|
|
}
|
|
|
|
filter_testcase basic basic-filename --path filename
|
|
filter_testcase basic basic-twenty --path twenty
|
|
filter_testcase basic basic-ten --path ten
|
|
|
|
test_done
|