@dotinc/ogre 0.10.3 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,58 +3,58 @@ TAP version 14
3
3
  ok 1 - has changelog entries
4
4
  ok 2 - incorrect \# of commits
5
5
  1..2
6
- ok 1 - baseline with 1 commit and zero changelog entries # time=63.548ms
6
+ ok 1 - baseline with 1 commit and zero changelog entries # time=72.932ms
7
7
 
8
8
  # Subtest: head points to main
9
9
  ok 1 - head not pointing where it should
10
10
  1..1
11
- ok 2 - head points to main # time=0.889ms
11
+ ok 2 - head points to main # time=0.972ms
12
12
 
13
13
  # Subtest: changes are available for commit if starting from empty
14
14
  ok 1 - Status does not contain the right amount of changes
15
15
  ok 2 - (unnamed test)
16
16
  1..2
17
- ok 3 - changes are available for commit if starting from empty # time=14.463ms
17
+ ok 3 - changes are available for commit if starting from empty # time=42.656ms
18
18
 
19
19
  # Subtest: no commit without changes
20
20
  ok 1 - expected to reject
21
21
  1..1
22
- ok 4 - no commit without changes # time=5.382ms
22
+ ok 4 - no commit without changes # time=4.461ms
23
23
 
24
24
  # Subtest: no commit without changes after recent commit
25
25
  ok 1 - expected to reject
26
26
  1..1
27
- ok 5 - no commit without changes after recent commit # time=4.126ms
27
+ ok 5 - no commit without changes after recent commit # time=5.106ms
28
28
 
29
29
  # Subtest: overwrite nested array changes are recognized
30
30
  1..0
31
- ok 6 - overwrite nested array changes are recognized # time=5.128ms
31
+ ok 6 - overwrite nested array changes are recognized # time=11.509ms
32
32
 
33
33
  # Subtest: change of nested array element is recognized
34
34
  1..0
35
- ok 7 - change of nested array element is recognized # time=6.271ms
35
+ ok 7 - change of nested array element is recognized # time=6.074ms
36
36
 
37
37
  # Subtest: treeHash of commit is matching content
38
38
  ok 1 - should be equal
39
39
  ok 2 - tree hash mismatch
40
40
  1..2
41
- ok 8 - treeHash of commit is matching content # time=14.351ms
41
+ ok 8 - treeHash of commit is matching content # time=16.705ms
42
42
 
43
43
  # Subtest: no commit --amend without commit
44
44
  ok 1 - expected to reject
45
45
  1..1
46
- ok 9 - no commit --amend without commit # time=7.499ms
46
+ ok 9 - no commit --amend without commit # time=2.355ms
47
47
 
48
48
  # Subtest: main moves to recent commit
49
49
  ok 1 - head does not point to recent commit
50
50
  1..1
51
- ok 10 - main moves to recent commit # time=14.945ms
51
+ ok 10 - main moves to recent commit # time=33.046ms
52
52
 
53
53
  # Subtest: two commits with 3 changes
54
54
  ok 1 - incorrect \# of changelog entries
55
55
  ok 2 - incorrect \# of commits
56
56
  1..2
57
- ok 11 - two commits with 3 changes # time=6.252ms
57
+ ok 11 - two commits with 3 changes # time=4.59ms
58
58
 
59
59
  # Subtest: array push double-change, 6 changes, 3 commits
60
60
  ok 1 - incorrect \# of changelog entries
@@ -62,7 +62,7 @@ ok 11 - two commits with 3 changes # time=6.252ms
62
62
  ok 3 - \#incorrect \# of changes in commit\#1
63
63
  ok 4 - \#incorrect \# of changes in commit\#2
64
64
  1..4
65
- ok 12 - array push double-change, 6 changes, 3 commits # time=30.44ms
65
+ ok 12 - array push double-change, 6 changes, 3 commits # time=10.49ms
66
66
 
67
67
  # Subtest: all refs OK, when committing on new branch while main is empty main
68
68
  ok 1 - main should not point to a commit
@@ -70,7 +70,7 @@ ok 12 - array push double-change, 6 changes, 3 commits # time=30.44ms
70
70
  ok 3 - branch should now be visible
71
71
  ok 4 - HEAD is pointing to wrong branch
72
72
  1..4
73
- ok 13 - all refs OK, when committing on new branch while main is empty main # time=6.922ms
73
+ ok 13 - all refs OK, when committing on new branch while main is empty main # time=8.615ms
74
74
 
75
75
  # Subtest: commit --amend changes hash on content change
76
76
  ok 1 - hash should have changed
@@ -80,7 +80,7 @@ ok 13 - all refs OK, when committing on new branch while main is empty main # ti
80
80
  ok 5 - we are on the wrong branch
81
81
  ok 6 - main should point to changed commit hash
82
82
  1..6
83
- ok 14 - commit --amend changes hash on content change # time=10.498ms
83
+ ok 14 - commit --amend changes hash on content change # time=23.044ms
84
84
 
85
85
  # Subtest: commit --amend changes hash on message change
86
86
  ok 1 - hash should have changed
@@ -90,7 +90,7 @@ ok 14 - commit --amend changes hash on content change # time=10.498ms
90
90
  ok 5 - we are on the wrong branch
91
91
  ok 6 - main should point to changed commit hash
92
92
  1..6
93
- ok 15 - commit --amend changes hash on message change # time=18.706ms
93
+ ok 15 - commit --amend changes hash on message change # time=20.452ms
94
94
 
95
95
  # Subtest: commit at detached HEAD does not affect main, but moves head
96
96
  ok 1 - HEAD did not move to commit
@@ -99,12 +99,12 @@ ok 15 - commit --amend changes hash on message change # time=18.706ms
99
99
  ok 4 - HEAD did not move to commit
100
100
  ok 5 - main branch did not stay at last commit
101
101
  1..5
102
- ok 16 - commit at detached HEAD does not affect main, but moves head # time=16.604ms
102
+ ok 16 - commit at detached HEAD does not affect main, but moves head # time=15.011ms
103
103
 
104
104
  # Subtest: commit at detached HEAD saved to a branch
105
105
  ok 1 - savepoint branch should point to last detached commit
106
106
  1..1
107
- ok 17 - commit at detached HEAD saved to a branch # time=6.032ms
107
+ ok 17 - commit at detached HEAD saved to a branch # time=7.824ms
108
108
 
109
109
  # Subtest: commit --amend changes hash on message change even in detached HEAD
110
110
  ok 1 - hash should have changed
@@ -114,6 +114,6 @@ ok 17 - commit at detached HEAD saved to a branch # time=6.032ms
114
114
  ok 5 - HEAD is not pointing to detached commit
115
115
  ok 6 - main should point to changed commit hash
116
116
  1..6
117
- ok 18 - commit --amend changes hash on message change even in detached HEAD # time=9.509ms
117
+ ok 18 - commit --amend changes hash on message change even in detached HEAD # time=25.83ms
118
118
 
119
119
  1..18
@@ -2,7 +2,7 @@ TAP version 14
2
2
  # Subtest: merge with no commit fails
3
3
  ok 1 - expected to throw
4
4
  1..1
5
- ok 1 - merge with no commit fails # time=43.034ms
5
+ ok 1 - merge with no commit fails # time=117.1ms
6
6
 
7
7
  # Subtest: merge fast-forward
8
8
  ok 1 - HEAD not pointing to new_branch
@@ -11,6 +11,6 @@ ok 1 - merge with no commit fails # time=43.034ms
11
11
  ok 4 - master is not at expected commit
12
12
  ok 5 - fast-forward failed, superfluous commit detected
13
13
  1..5
14
- ok 2 - merge fast-forward # time=33.688ms
14
+ ok 2 - merge fast-forward # time=18.126ms
15
15
 
16
16
  1..2
@@ -1,9 +1,9 @@
1
1
  TAP version 14
2
2
  # Subtest: diff is ok
3
3
  ok 1 - main is pointing at wrong commit
4
- ok 2 - invalid \# of change entries: [{"op":"add","path":"/nested/0","value":{"uuid":"fea5b57a-b39b-4808-bf16-ad25153e7901","name":"new name"}},{"op":"add","path":"/nested/1","value":{"uuid":"bd47586c-e9b8-4a35-9a5e-4921fe98c90f","name":"first name"}}]
4
+ ok 2 - invalid \# of change entries: [{"op":"add","path":"/nested/0","value":{"uuid":"79c77650-cca9-4f0c-8f9f-6cd2da81dd30","name":"new name"}},{"op":"add","path":"/nested/1","value":{"uuid":"755ade05-6e26-4bb1-91b1-8550e55036c2","name":"first name"}}]
5
5
  1..2
6
- ok 1 - diff is ok # time=61.966ms
6
+ ok 1 - diff is ok # time=167.32ms
7
7
 
8
8
  # Subtest: restore
9
9
  # Subtest: history check
@@ -13,7 +13,7 @@ ok 1 - diff is ok # time=61.966ms
13
13
  ok 4 - incorrect \# of commits
14
14
  ok 5 - incorrect \# of changelog entries
15
15
  1..5
16
- ok 1 - history check # time=61.836ms
16
+ ok 1 - history check # time=65.717ms
17
17
 
18
18
  # Subtest: reconstruct with 2 commits
19
19
  ok 1 - main is pointing at wrong commit
@@ -22,17 +22,17 @@ ok 1 - diff is ok # time=61.966ms
22
22
  ok 4 - incorrect \# of commits
23
23
  ok 5 - incorrect \# of changelog entries
24
24
  1..5
25
- ok 2 - reconstruct with 2 commits # time=14.616ms
25
+ ok 2 - reconstruct with 2 commits # time=12.83ms
26
26
 
27
27
  1..2
28
- ok 2 - restore # time=121.742ms
28
+ ok 2 - restore # time=134.895ms
29
29
 
30
30
  # Subtest: history
31
31
  # Subtest: successful restore
32
32
  ok 1 - restored object does not equal last version.
33
33
  ok 2 - should not be the js ref
34
34
  1..2
35
- ok 1 - successful restore # time=338.281ms
35
+ ok 1 - successful restore # time=254.665ms
36
36
 
37
37
  # Subtest: remoteRefs doesn't change on commit
38
38
  ok 1 - input history refs and remote before change should not be the same object
@@ -41,7 +41,7 @@ ok 2 - restore # time=121.742ms
41
41
  ok 4 - history refs must not be the same as static remotes
42
42
  ok 5 - histories must not match anymore
43
43
  1..5
44
- ok 2 - remoteRefs doesn't change on commit # time=9.293ms
44
+ ok 2 - remoteRefs doesn't change on commit # time=16.036ms
45
45
 
46
46
  # Subtest: history contains HEAD ref
47
47
  ok 1 - should be equal
@@ -49,15 +49,15 @@ ok 2 - restore # time=121.742ms
49
49
  ok 3 - should be equal
50
50
  ok 4 - should be equal
51
51
  1..4
52
- ok 3 - history contains HEAD ref # time=1.261ms
52
+ ok 3 - history contains HEAD ref # time=1.153ms
53
53
 
54
54
  # Subtest: empty history unreachable HEAD
55
55
  ok 1 - expected to throw
56
56
  1..1
57
- ok 4 - empty history unreachable HEAD # time=1.963ms
57
+ ok 4 - empty history unreachable HEAD # time=1.648ms
58
58
 
59
59
  1..4
60
- ok 3 - history # time=466.698ms
60
+ ok 3 - history # time=399.139ms
61
61
 
62
62
  # Subtest: reset
63
63
  # Subtest: reset hard
@@ -65,54 +65,54 @@ ok 3 - history # time=466.698ms
65
65
  ok 2 - wrong \# of changes in diff
66
66
  ok 3 - failed to reset
67
67
  1..3
68
- ok 1 - reset hard # time=3.088ms
68
+ ok 1 - reset hard # time=23.536ms
69
69
 
70
70
  1..1
71
- ok 4 - reset # time=82.806ms
71
+ ok 4 - reset # time=83.143ms
72
72
 
73
73
  # Subtest: status
74
74
  # Subtest: clean repo no change
75
75
  ok 1 - Shouldn't have pending changes
76
76
  1..1
77
- ok 1 - clean repo no change # time=445.374ms
77
+ ok 1 - clean repo no change # time=331.028ms
78
78
 
79
79
  # Subtest: clean repo pending change
80
80
  ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
81
81
  1..1
82
- ok 2 - clean repo pending change # time=1.153ms
82
+ ok 2 - clean repo pending change # time=0.707ms
83
83
 
84
84
  # Subtest: reading status shouldn't clean observer
85
85
  ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
86
86
  ok 2 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
87
87
  ok 3 - why different pending changes??
88
88
  1..3
89
- ok 3 - reading status shouldn't clean observer # time=1.756ms
89
+ ok 3 - reading status shouldn't clean observer # time=0.85ms
90
90
 
91
91
  # Subtest: after commit no change
92
92
  ok 1 - Shouldn't have pending changes
93
93
  1..1
94
- ok 4 - after commit no change # time=5.188ms
94
+ ok 4 - after commit no change # time=2.781ms
95
95
 
96
96
  # Subtest: after commit pending change
97
97
  ok 1 - Shouldn't have pending changes
98
98
  ok 2 - Status doesn't contain changes
99
99
  1..2
100
- ok 5 - after commit pending change # time=2.061ms
100
+ ok 5 - after commit pending change # time=1.809ms
101
101
 
102
102
  # Subtest: after commit pending change for rewrite array
103
103
  ok 1 - Shouldn't have pending changes
104
104
  ok 2 - Status doesn't contain changes
105
105
  1..2
106
- ok 6 - after commit pending change for rewrite array # time=1.764ms
106
+ ok 6 - after commit pending change for rewrite array # time=9.824ms
107
107
 
108
108
  # Subtest: change of nested array element prop
109
109
  ok 1 - Shouldn't have pending changes
110
110
  ok 2 - Status doesn't contain changes
111
111
  1..2
112
- ok 7 - change of nested array element prop # time=5.018ms
112
+ ok 7 - change of nested array element prop # time=11.162ms
113
113
 
114
114
  1..7
115
- ok 5 - status # time=530.878ms
115
+ ok 5 - status # time=439.237ms
116
116
 
117
117
  # Subtest: apply
118
118
  # Subtest: single patch
@@ -122,7 +122,7 @@ ok 5 - status # time=530.878ms
122
122
  ok 4 - Status doesn't contain changes
123
123
  ok 5 - It should have the right changes
124
124
  1..5
125
- ok 1 - single patch # time=200.288ms
125
+ ok 1 - single patch # time=167.135ms
126
126
 
127
127
  # Subtest: patch for undefined props with workaround
128
128
  ok 1 - Shouldn't have pending changes
@@ -130,7 +130,7 @@ ok 5 - status # time=530.878ms
130
130
  ok 3 - The final state should match up
131
131
  ok 4 - Status should contain 1 change
132
132
  1..4
133
- ok 2 - patch for undefined props with workaround # time=1.512ms
133
+ ok 2 - patch for undefined props with workaround # time=1.743ms
134
134
 
135
135
  # Subtest: multiple patches
136
136
  ok 1 - Shouldn't have pending changes
@@ -139,10 +139,10 @@ ok 5 - status # time=530.878ms
139
139
  ok 4 - It should have the right changes
140
140
  ok 5 - The final state does not match up
141
141
  1..5
142
- ok 3 - multiple patches # time=1.934ms
142
+ ok 3 - multiple patches # time=1.976ms
143
143
 
144
144
  1..3
145
- ok 6 - apply # time=277.685ms
145
+ ok 6 - apply # time=285.169ms
146
146
 
147
147
  # Subtest: pending changes - push helpers
148
148
  # Subtest: 1 commit & 1 ref update
@@ -151,7 +151,7 @@ ok 6 - apply # time=277.685ms
151
151
  ok 3 - wrong pending commit
152
152
  ok 4 - wrong pending ref update
153
153
  1..4
154
- ok 1 - 1 commit & 1 ref update # time=581.505ms
154
+ ok 1 - 1 commit & 1 ref update # time=550.931ms
155
155
 
156
156
  # Subtest: 2 commit & 1 ref update
157
157
  ok 1 - incorrect number of pending commits
@@ -159,7 +159,7 @@ ok 6 - apply # time=277.685ms
159
159
  ok 3 - wrong pending commits
160
160
  ok 4 - wrong pending ref update
161
161
  1..4
162
- ok 2 - 2 commit & 1 ref update # time=11.802ms
162
+ ok 2 - 2 commit & 1 ref update # time=7.759ms
163
163
 
164
164
  # Subtest: 1 commit & 2 ref updates
165
165
  ok 1 - incorrect number of pending commits
@@ -167,7 +167,7 @@ ok 6 - apply # time=277.685ms
167
167
  ok 3 - wrong pending commits
168
168
  ok 4 - wrong pending ref update
169
169
  1..4
170
- ok 3 - 1 commit & 2 ref updates # time=7.276ms
170
+ ok 3 - 1 commit & 2 ref updates # time=53.744ms
171
171
 
172
172
  # Subtest: 2 commit & 2 ref updates
173
173
  ok 1 - incorrect number of pending commits
@@ -175,7 +175,7 @@ ok 6 - apply # time=277.685ms
175
175
  ok 3 - wrong pending commits
176
176
  ok 4 - wrong pending ref update
177
177
  1..4
178
- ok 4 - 2 commit & 2 ref updates # time=5.659ms
178
+ ok 4 - 2 commit & 2 ref updates # time=5.857ms
179
179
 
180
180
  # Subtest: 3 commit & 2 ref updates
181
181
  ok 1 - incorrect number of pending commits
@@ -183,7 +183,7 @@ ok 6 - apply # time=277.685ms
183
183
  ok 3 - wrong pending commits
184
184
  ok 4 - wrong pending ref update
185
185
  1..4
186
- ok 5 - 3 commit & 2 ref updates # time=27.891ms
186
+ ok 5 - 3 commit & 2 ref updates # time=29.052ms
187
187
 
188
188
  # Subtest: 3 commit & 3 ref updates
189
189
  ok 1 - incorrect number of pending commits
@@ -191,7 +191,7 @@ ok 6 - apply # time=277.685ms
191
191
  ok 3 - wrong pending commits
192
192
  ok 4 - wrong pending ref update
193
193
  1..4
194
- ok 6 - 3 commit & 3 ref updates # time=8.929ms
194
+ ok 6 - 3 commit & 3 ref updates # time=11.19ms
195
195
 
196
196
  # Subtest: after merge 1 commit & 3 ref updates
197
197
  ok 1 - incorrect number of pending commits
@@ -199,7 +199,7 @@ ok 6 - apply # time=277.685ms
199
199
  ok 3 - wrong pending commits
200
200
  ok 4 - wrong pending ref update
201
201
  1..4
202
- ok 7 - after merge 1 commit & 3 ref updates # time=6.342ms
202
+ ok 7 - after merge 1 commit & 3 ref updates # time=6.193ms
203
203
 
204
204
  # Subtest: after merge 1 commit & 2 ref updates
205
205
  ok 1 - incorrect number of pending commits
@@ -207,7 +207,7 @@ ok 6 - apply # time=277.685ms
207
207
  ok 3 - wrong pending commits
208
208
  ok 4 - wrong pending ref update
209
209
  1..4
210
- ok 8 - after merge 1 commit & 2 ref updates # time=3.736ms
210
+ ok 8 - after merge 1 commit & 2 ref updates # time=4.803ms
211
211
 
212
212
  # Subtest: no merge 1 commit & 1 ref updates
213
213
  ok 1 - incorrect number of pending commits
@@ -215,7 +215,7 @@ ok 6 - apply # time=277.685ms
215
215
  ok 3 - wrong pending commits
216
216
  ok 4 - wrong pending ref update
217
217
  1..4
218
- ok 9 - no merge 1 commit & 1 ref updates # time=3.413ms
218
+ ok 9 - no merge 1 commit & 1 ref updates # time=3.838ms
219
219
 
220
220
  # Subtest: no merge no commit & 1 ref updates
221
221
  ok 1 - incorrect number of pending commits
@@ -223,9 +223,9 @@ ok 6 - apply # time=277.685ms
223
223
  ok 3 - wrong pending commits
224
224
  ok 4 - wrong pending ref update
225
225
  1..4
226
- ok 10 - no merge no commit & 1 ref updates # time=2.543ms
226
+ ok 10 - no merge no commit & 1 ref updates # time=2.784ms
227
227
 
228
228
  1..10
229
- ok 7 - pending changes - push helpers # time=741.45ms
229
+ ok 7 - pending changes - push helpers # time=762.552ms
230
230
 
231
231
  1..7
@@ -2,18 +2,18 @@ TAP version 14
2
2
  # Subtest: cannot tag on an empty repo
3
3
  ok 1 - expected to throw
4
4
  1..1
5
- ok 1 - cannot tag on an empty repo # time=21.173ms
5
+ ok 1 - cannot tag on an empty repo # time=33.578ms
6
6
 
7
7
  # Subtest: can create simple tag pointing to HEAD
8
8
  ok 1 - should be equal
9
9
  ok 2 - tag is not pointing to expected commit
10
10
  ok 3 - reference was not present in history
11
11
  1..3
12
- ok 2 - can create simple tag pointing to HEAD # time=7.632ms
12
+ ok 2 - can create simple tag pointing to HEAD # time=83.909ms
13
13
 
14
14
  # Subtest: cannot create tag with whitespace
15
15
  ok 1 - expected to throw
16
16
  1..1
17
- ok 3 - cannot create tag with whitespace # time=4.171ms
17
+ ok 3 - cannot create tag with whitespace # time=19.405ms
18
18
 
19
19
  1..3
@@ -3,42 +3,42 @@ TAP version 14
3
3
  ok 1 - should be equal
4
4
  ok 2 - should be equal
5
5
  1..2
6
- ok 1 - author <email@domain.info> # time=3.82ms
6
+ ok 1 - author <email@domain.info> # time=3.584ms
7
7
 
8
8
  # Subtest: author with space <email@domain.info>
9
9
  ok 1 - should be equal
10
10
  ok 2 - should be equal
11
11
  1..2
12
- ok 2 - author with space <email@domain.info> # time=0.787ms
12
+ ok 2 - author with space <email@domain.info> # time=0.642ms
13
13
 
14
14
  # Subtest: author @handle
15
15
  ok 1 - should be equal
16
16
  ok 2 - should be equal
17
17
  1..2
18
- ok 3 - author @handle # time=0.543ms
18
+ ok 3 - author @handle # time=0.406ms
19
19
 
20
20
  # Subtest: author with space @handle
21
21
  ok 1 - should be equal
22
22
  ok 2 - should be equal
23
23
  1..2
24
- ok 4 - author with space @handle # time=0.558ms
24
+ ok 4 - author with space @handle # time=0.401ms
25
25
 
26
26
  # Subtest: email@domain.info
27
27
  ok 1 - should be equal
28
28
  ok 2 - should be equal
29
29
  1..2
30
- ok 5 - email@domain.info # time=0.722ms
30
+ ok 5 - email@domain.info # time=0.549ms
31
31
 
32
32
  # Subtest: @handle
33
33
  ok 1 - should be equal
34
34
  ok 2 - should be equal
35
35
  1..2
36
- ok 6 - @handle # time=0.699ms
36
+ ok 6 - @handle # time=0.58ms
37
37
 
38
38
  # Subtest: empty author
39
39
  ok 1 - expected to throw
40
40
  1..1
41
- ok 7 - empty author # time=3.033ms
41
+ ok 7 - empty author # time=2.173ms
42
42
 
43
43
  # Subtest: mapPath
44
44
  # Subtest: find root
@@ -46,7 +46,7 @@ ok 7 - empty author # time=3.033ms
46
46
  ok 2 - root is not ancestor of commit
47
47
  ok 3 - path does not contain the right commit
48
48
  1..3
49
- ok 1 - find root # time=56.745ms
49
+ ok 1 - find root # time=78.962ms
50
50
 
51
51
  # Subtest: finds full path to root
52
52
  ok 1 - path does not contain 1 commit
@@ -54,13 +54,13 @@ ok 7 - empty author # time=3.033ms
54
54
  ok 3 - path does not contain the right commit at 0
55
55
  ok 4 - path does not contain the right commit at 1
56
56
  1..4
57
- ok 2 - finds full path to root # time=5.903ms
57
+ ok 2 - finds full path to root # time=4.862ms
58
58
 
59
59
  # Subtest: parent-to-child no ancestor
60
60
  ok 1 - path contains a commit
61
61
  ok 2 - child must not be an ancestor of parent
62
62
  1..2
63
- ok 3 - parent-to-child no ancestor # time=3.901ms
63
+ ok 3 - parent-to-child no ancestor # time=4.391ms
64
64
 
65
65
  # Subtest: finds path across 2 branches
66
66
  ok 1 - path does not contain 1 commit
@@ -68,9 +68,9 @@ ok 7 - empty author # time=3.033ms
68
68
  ok 3 - path does not contain the right commit at 0
69
69
  ok 4 - path does not contain the right commit at 1
70
70
  1..4
71
- ok 4 - finds path across 2 branches # time=4.368ms
71
+ ok 4 - finds path across 2 branches # time=4.994ms
72
72
 
73
73
  1..4
74
- ok 8 - mapPath # time=89.688ms
74
+ ok 8 - mapPath # time=110.921ms
75
75
 
76
76
  1..8
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v0.11.0 (Thu Jun 20 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - feat: temporal support [#186](https://github.com/dotindustries/ogre/pull/186) ([@nadilas](https://github.com/nadilas))
6
+ - feat: allow override of hash algo for temporal support ([@nadilas](https://github.com/nadilas))
7
+
8
+ #### Authors: 1
9
+
10
+ - [@nadilas](https://github.com/nadilas)
11
+
12
+ ---
13
+
1
14
  # v0.10.3 (Tue Jun 11 2024)
2
15
 
3
16
  #### 🐛 Bug Fix
@@ -1,10 +1,11 @@
1
1
  import { JsonPatchError, Operation } from "fast-json-patch";
2
- import { Commit } from "./commit.js";
3
- import { History, Reference } from "./interfaces.js";
4
- export interface RepositoryOptions<T extends {
5
- [k: string]: any;
6
- }> {
2
+ import type { Commit, CommitHashContent } from "./commit.js";
3
+ import type { History, Reference } from "./interfaces.js";
4
+ export interface RepositoryOptions {
7
5
  history?: History;
6
+ overrides?: {
7
+ calculateCommitHashFn?: (content: CommitHashContent) => Promise<string>;
8
+ };
8
9
  }
9
10
  export interface RepositoryObject<T extends {
10
11
  [k: string]: any;
@@ -64,9 +65,10 @@ export interface RepositoryObject<T extends {
64
65
  export declare class Repository<T extends {
65
66
  [k: PropertyKey]: any;
66
67
  }> implements RepositoryObject<T> {
67
- constructor(obj: Partial<T>, options: RepositoryOptions<T>);
68
+ constructor(obj: Partial<T>, options: RepositoryOptions);
68
69
  private readonly original;
69
70
  data: T;
71
+ private readonly hashFn;
70
72
  private readonly remoteRefs;
71
73
  private readonly remoteCommits;
72
74
  private observer;
package/lib/repository.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { applyPatch, applyReducer, compare, deepClone, generate, observe, unobserve, validate, } from "fast-json-patch";
2
- import { calculateCommitHash } from "./commit.js";
3
2
  import { brancheNameToRef, cleanRefValue, commitAtRefIn, createHeadRefValue, getLastRefPathElement, headValueRefPrefix, immutableArrayCopy, immutableMapCopy, localHeadPathPrefix, mapPath, mutableMapCopy, objectToTree, REFS_HEAD_KEY, REFS_MAIN_KEY, refsAtCommit, shaishToCommit, tagToRef, treeToObject, validateBranchName, validateRef, } from "./utils.js";
4
3
  /**
5
4
  * A repository recording and managing the state transitions of an object
6
5
  */
7
6
  export class Repository {
8
7
  constructor(obj, options) {
9
- var _a, _b, _c, _d, _e, _f;
8
+ var _a, _b, _c, _d, _e, _f, _g;
9
+ this.hashFn = (_a = options.overrides) === null || _a === void 0 ? void 0 : _a.calculateCommitHashFn;
10
10
  // FIXME: move this to refs/remote as git would do?
11
- this.remoteRefs = immutableMapCopy((_a = options.history) === null || _a === void 0 ? void 0 : _a.refs);
12
- this.remoteCommits = immutableArrayCopy((_b = options.history) === null || _b === void 0 ? void 0 : _b.commits, (c) => c.hash);
11
+ this.remoteRefs = immutableMapCopy((_b = options.history) === null || _b === void 0 ? void 0 : _b.refs);
12
+ this.remoteCommits = immutableArrayCopy((_c = options.history) === null || _c === void 0 ? void 0 : _c.commits, (c) => c.hash);
13
13
  this.original = deepClone(obj);
14
14
  // store js ref, so obj can still be modified without going through repo.data
15
15
  this.data = obj;
16
16
  this.observer = observe(obj);
17
- this.refs = ((_c = options.history) === null || _c === void 0 ? void 0 : _c.refs)
18
- ? mutableMapCopy((_d = options.history) === null || _d === void 0 ? void 0 : _d.refs)
17
+ this.refs = ((_d = options.history) === null || _d === void 0 ? void 0 : _d.refs)
18
+ ? mutableMapCopy((_e = options.history) === null || _e === void 0 ? void 0 : _e.refs)
19
19
  : new Map([
20
20
  [
21
21
  REFS_HEAD_KEY,
@@ -25,7 +25,7 @@ export class Repository {
25
25
  },
26
26
  ],
27
27
  ]);
28
- this.commits = (_f = (_e = options.history) === null || _e === void 0 ? void 0 : _e.commits) !== null && _f !== void 0 ? _f : [];
28
+ this.commits = (_g = (_f = options.history) === null || _f === void 0 ? void 0 : _f.commits) !== null && _g !== void 0 ? _g : [];
29
29
  if (options.history) {
30
30
  const commit = this.commitAtHead();
31
31
  if (!commit) {
@@ -223,7 +223,7 @@ export class Repository {
223
223
  }
224
224
  }
225
225
  async commit(message, author, amend) {
226
- var _a, _b;
226
+ var _a, _b, _c;
227
227
  let parent = this.commitAtHead();
228
228
  if (amend && !parent) {
229
229
  throw new Error(`no commit to amend`);
@@ -245,6 +245,7 @@ export class Repository {
245
245
  ? parent.changes
246
246
  : [];
247
247
  const changes = [...parentChanges, ...patch];
248
+ const calculateCommitHash = (_c = this.hashFn) !== null && _c !== void 0 ? _c : (await import("./commit.js")).calculateCommitHash;
248
249
  const sha = await calculateCommitHash({
249
250
  message,
250
251
  author,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/dotindustries/ogre.git"
6
6
  },
7
- "version": "0.10.3",
7
+ "version": "0.11.0",
8
8
  "description": "Git-like repository for in-memory object versioning",
9
9
  "private": false,
10
10
  "main": "lib/index.js",
@@ -39,5 +39,5 @@
39
39
  "registry": "https://registry.npmjs.org/",
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "7f97384355a9adf8599fce36ee67252b2d94dd91"
42
+ "gitHead": "551bb7f1b95f47eae16094f3ce448d24c1dfe255"
43
43
  }