filter-repo: add more path-related testcases

Add some testcases for multiple --path arguments, for --path-glob, and
for --path-regex.

Signed-off-by: Elijah Newren <newren@gmail.com>
pull/13/head
Elijah Newren 5 years ago
parent 2431904f26
commit 4635102d0f

@ -22,7 +22,7 @@ filter_testcase() {
rm .git/packed-refs &&
# Run the example
cat $DATA/$INPUT | git filter-repo --stdin --quiet --force ${REST[@]} &&
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 &&
@ -33,6 +33,9 @@ filter_testcase() {
filter_testcase basic basic-filename --path filename
filter_testcase basic basic-twenty --path twenty
filter_testcase basic basic-ten --path ten
filter_testcase basic basic-numbers --path ten --path twenty
filter_testcase basic basic-filename --invert-paths --path-glob 't*en*'
filter_testcase basic basic-numbers --invert-paths --path-regex 'f.*e.*e'
filter_testcase basic basic-mailmap --mailmap ../t9390/sample-mailmap
filter_testcase basic basic-replace --replace-text ../t9390/sample-replace

@ -0,0 +1,76 @@
feature done
blob
mark :1
data 8
initial
reset refs/heads/B
commit refs/heads/B
mark :2
author Little O. Me <me@little.net> 1535228562 -0700
committer Little O. Me <me@little.net> 1535228562 -0700
data 8
Initial
M 100644 :1 ten
M 100644 :1 twenty
blob
mark :3
data 11
twenty-mod
commit refs/heads/B
mark :4
author Little 'ol Me <me@laptop.(none)> 1535229544 -0700
committer Little 'ol Me <me@laptop.(none)> 1535229544 -0700
data 11
add twenty
from :2
M 100644 :3 twenty
blob
mark :5
data 8
ten-mod
commit refs/heads/A
mark :6
author Little O. Me <me@machine52.little.net> 1535229523 -0700
committer Little O. Me <me@machine52.little.net> 1535229523 -0700
data 8
add ten
from :2
M 100644 :5 ten
commit refs/heads/master
mark :7
author Lit.e Me <me@fire.com> 1535229559 -0700
committer Lit.e Me <me@fire.com> 1535229580 -0700
data 24
Merge branch 'A' into B
from :4
merge :6
M 100644 :5 ten
blob
mark :8
data 6
final
commit refs/heads/master
mark :9
author Little Me <me@bigcompany.com> 1535229601 -0700
committer Little Me <me@bigcompany.com> 1535229601 -0700
data 9
whatever
from :7
M 100644 :8 ten
M 100644 :8 twenty
tag v1.0
from :9
tagger Little John <second@merry.men> 1535229618 -0700
data 5
v1.0
done
Loading…
Cancel
Save