mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-05 09:52:15 +02:00
filter-repo: add testcases dealing with commit pruning
There are several cases to worry about with commit pruning; commits that start empty and had no parent, commits that start empty and had a parent which may or may not get pruned, commits which had changes but became empty, commits which were merges but lost a line of ancestry and have no changes of their own, etc. Add testcases covering these cases, though most topology related ones will be deferred to a later set of tests. Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
32c556be80
commit
49732e8b5f
@ -38,5 +38,6 @@ 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
|
||||
filter_testcase empty empty-keepme --path keepme
|
||||
|
||||
test_done
|
||||
|
127
t/t9390/empty
Normal file
127
t/t9390/empty
Normal file
@ -0,0 +1,127 @@
|
||||
feature done
|
||||
# Simple repo with only two files, with a whole bunch of cases dealing with
|
||||
# empty pruning, particularly commits that start empty.
|
||||
#
|
||||
# As with case1, the original-oid directives are very fake, but if an error
|
||||
# is hit that shows one of these, it makes it really easy to know where it
|
||||
# came from.
|
||||
blob
|
||||
mark :1
|
||||
original-oid 0000000000000000000000000000000000000001
|
||||
data 10
|
||||
nukeme v1
|
||||
|
||||
blob
|
||||
mark :2
|
||||
original-oid 0000000000000000000000000000000000000002
|
||||
data 10
|
||||
keepme v1
|
||||
|
||||
blob
|
||||
mark :3
|
||||
original-oid 0000000000000000000000000000000000000003
|
||||
data 10
|
||||
nukeme v2
|
||||
|
||||
blob
|
||||
mark :4
|
||||
original-oid 0000000000000000000000000000000000000004
|
||||
data 10
|
||||
keepme v2
|
||||
|
||||
commit refs/heads/master
|
||||
mark :5
|
||||
original-oid 0000000000000000000000000000000000000010
|
||||
author Full Name <user@organization.tld> 1000000000 +0100
|
||||
committer Full Name <user@organization.tld> 1000000000 +0100
|
||||
data 2
|
||||
A
|
||||
|
||||
commit refs/heads/master
|
||||
mark :6
|
||||
original-oid 0000000000000000000000000000000000000011
|
||||
author Full Name <user@organization.tld> 1000010000 +0100
|
||||
committer Full Name <user@organization.tld> 1000010000 +0100
|
||||
data 2
|
||||
B
|
||||
from :5
|
||||
|
||||
commit refs/heads/master
|
||||
mark :7
|
||||
original-oid 0000000000000000000000000000000000000012
|
||||
author Full Name <user@organization.tld> 1000020000 +0100
|
||||
committer Full Name <user@organization.tld> 1000020000 +0100
|
||||
data 2
|
||||
C
|
||||
M 100644 :1 nukeme
|
||||
|
||||
commit refs/heads/master
|
||||
mark :8
|
||||
original-oid 0000000000000000000000000000000000000013
|
||||
author Full Name <user@organization.tld> 1000030000 +0100
|
||||
committer Full Name <user@organization.tld> 1000030000 +0100
|
||||
data 2
|
||||
D
|
||||
from :7
|
||||
|
||||
commit refs/heads/master
|
||||
mark :9
|
||||
original-oid 0000000000000000000000000000000000000014
|
||||
author Full Name <user@organization.tld> 1000040000 +0100
|
||||
committer Full Name <user@organization.tld> 1000040000 +0100
|
||||
data 29
|
||||
E: Merge commit 'D' into 'B'
|
||||
from :6
|
||||
merge :8
|
||||
M 100644 :2 keepme
|
||||
|
||||
commit refs/heads/master
|
||||
mark :10
|
||||
original-oid 0000000000000000000000000000000000000015
|
||||
author Full Name <user@organization.tld> 1000050000 +0100
|
||||
committer Full Name <user@organization.tld> 1000050000 +0100
|
||||
data 29
|
||||
F: Merge commit 'D' into 'B'
|
||||
from :6
|
||||
merge :8
|
||||
|
||||
commit refs/heads/master
|
||||
mark :11
|
||||
original-oid 0000000000000000000000000000000000000016
|
||||
author Full Name <user@organization.tld> 1000060000 +0100
|
||||
committer Full Name <user@organization.tld> 1000060000 +0100
|
||||
data 2
|
||||
G
|
||||
from :9
|
||||
M 100644 :3 nukeme
|
||||
|
||||
commit refs/heads/master
|
||||
mark :12
|
||||
original-oid 0000000000000000000000000000000000000017
|
||||
author Full Name <user@organization.tld> 1000070000 +0100
|
||||
committer Full Name <user@organization.tld> 1000070000 +0100
|
||||
data 2
|
||||
H
|
||||
from :11
|
||||
|
||||
commit refs/heads/master
|
||||
mark :13
|
||||
original-oid 0000000000000000000000000000000000000018
|
||||
author Full Name <user@organization.tld> 1000080000 +0100
|
||||
committer Full Name <user@organization.tld> 1000080000 +0100
|
||||
data 2
|
||||
I
|
||||
from :10
|
||||
M 100644 :4 keepme
|
||||
|
||||
commit refs/heads/master
|
||||
mark :14
|
||||
original-oid 0000000000000000000000000000000000000019
|
||||
author Full Name <user@organization.tld> 1000090000 +0100
|
||||
committer Full Name <user@organization.tld> 1000090000 +0100
|
||||
data 29
|
||||
J: Merge commit 'I' into 'H'
|
||||
from :12
|
||||
merge :13
|
||||
|
||||
done
|
55
t/t9390/empty-keepme
Normal file
55
t/t9390/empty-keepme
Normal file
@ -0,0 +1,55 @@
|
||||
feature done
|
||||
reset refs/heads/master
|
||||
commit refs/heads/master
|
||||
mark :1
|
||||
author Full Name <user@organization.tld> 1000000000 +0100
|
||||
committer Full Name <user@organization.tld> 1000000000 +0100
|
||||
data 2
|
||||
A
|
||||
|
||||
commit refs/heads/master
|
||||
mark :2
|
||||
author Full Name <user@organization.tld> 1000010000 +0100
|
||||
committer Full Name <user@organization.tld> 1000010000 +0100
|
||||
data 2
|
||||
B
|
||||
from :1
|
||||
|
||||
blob
|
||||
mark :3
|
||||
data 10
|
||||
keepme v1
|
||||
|
||||
commit refs/heads/master
|
||||
mark :4
|
||||
author Full Name <user@organization.tld> 1000040000 +0100
|
||||
committer Full Name <user@organization.tld> 1000040000 +0100
|
||||
data 29
|
||||
E: Merge commit 'D' into 'B'
|
||||
from :2
|
||||
M 100644 :3 keepme
|
||||
|
||||
blob
|
||||
mark :5
|
||||
data 10
|
||||
keepme v2
|
||||
|
||||
commit refs/heads/master
|
||||
mark :6
|
||||
author Full Name <user@organization.tld> 1000080000 +0100
|
||||
committer Full Name <user@organization.tld> 1000080000 +0100
|
||||
data 2
|
||||
I
|
||||
from :2
|
||||
M 100644 :5 keepme
|
||||
|
||||
commit refs/heads/master
|
||||
mark :7
|
||||
author Full Name <user@organization.tld> 1000090000 +0100
|
||||
committer Full Name <user@organization.tld> 1000090000 +0100
|
||||
data 29
|
||||
J: Merge commit 'I' into 'H'
|
||||
from :4
|
||||
merge :6
|
||||
|
||||
done
|
Loading…
Reference in New Issue
Block a user