@dotinc/ogre 0.15.2 → 0.15.4
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.
- package/.tap/processinfo/{b893cc9b-8b53-4f50-a15e-990a1a80ee4e.json → 12d81008-bcf8-4baa-b971-7aa776f29fcf.json} +53 -53
- package/.tap/processinfo/{d06a4835-0aa2-49e6-8bc7-325a75e21292.json → 25f2adea-19ac-4343-918c-6cbb4ff012d7.json} +105 -105
- package/.tap/processinfo/{8bafbc84-440a-4e07-8123-bc55371b52fe.json → 378d2cec-e359-4412-a0f2-a50c75528d44.json} +41 -41
- package/.tap/processinfo/{773284b8-944d-48e0-a0af-d977d8e45c75.json → 8feb5b61-dc5c-41ac-b5dd-8361b68f5097.json} +86 -86
- package/.tap/processinfo/{1495c882-1470-4b5b-aab3-b7fa7a6a479e.json → 93d1603d-bb36-4f29-a444-ae5bc3c2fc52.json} +168 -168
- package/.tap/processinfo/{3301a9df-9ce4-45a3-8566-176b52c2304c.json → e8794bd9-71ff-4a50-8edb-9f5ea2e68c9d.json} +116 -116
- package/.tap/processinfo/{0e8cdeee-0c39-4247-9ac4-becc08cbf9b6.json → ec285d9e-16a3-425c-9c72-793b0a6319f2.json} +106 -106
- package/.tap/test-results/src/branch.test.ts.tap +6 -6
- package/.tap/test-results/src/checkout.test.ts.tap +23 -10
- package/.tap/test-results/src/commit.test.ts.tap +18 -18
- package/.tap/test-results/src/merge.test.ts.tap +2 -2
- package/.tap/test-results/src/repository.test.ts.tap +39 -39
- package/.tap/test-results/src/tag.test.ts.tap +3 -3
- package/.tap/test-results/src/utils.test.ts.tap +12 -12
- package/CHANGELOG.md +24 -0
- package/lib/repository.d.ts +1 -1
- package/lib/repository.js +9 -14
- package/package.json +2 -2
- package/src/checkout.test.ts +44 -0
- package/src/repository.ts +9 -22
|
@@ -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=
|
|
6
|
+
ok 1 - baseline with 1 commit and zero changelog entries # time=80.224ms
|
|
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=1.
|
|
11
|
+
ok 2 - head points to main # time=1.052ms
|
|
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=
|
|
17
|
+
ok 3 - changes are available for commit if starting from empty # time=83.103ms
|
|
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=
|
|
22
|
+
ok 4 - no commit without changes # time=11.979ms
|
|
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=7.
|
|
27
|
+
ok 5 - no commit without changes after recent commit # time=7.454ms
|
|
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=
|
|
31
|
+
ok 6 - overwrite nested array changes are recognized # time=12.373ms
|
|
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=
|
|
35
|
+
ok 7 - change of nested array element is recognized # time=13.584ms
|
|
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=
|
|
41
|
+
ok 8 - treeHash of commit is matching content # time=9.615ms
|
|
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=
|
|
46
|
+
ok 9 - no commit --amend without commit # time=1.97ms
|
|
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=
|
|
51
|
+
ok 10 - main moves to recent commit # time=7.081ms
|
|
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=
|
|
57
|
+
ok 11 - two commits with 3 changes # time=7.466ms
|
|
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=5.702ms
|
|
|
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=
|
|
65
|
+
ok 12 - array push double-change, 6 changes, 3 commits # time=12.202ms
|
|
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=10.462ms
|
|
|
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=
|
|
73
|
+
ok 13 - all refs OK, when committing on new branch while main is empty main # time=7.915ms
|
|
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=12.
|
|
83
|
+
ok 14 - commit --amend changes hash on content change # time=12.984ms
|
|
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=12.052ms
|
|
|
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=
|
|
93
|
+
ok 15 - commit --amend changes hash on message change # time=22.195ms
|
|
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=17.247ms
|
|
|
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=
|
|
102
|
+
ok 16 - commit at detached HEAD does not affect main, but moves head # time=20.984ms
|
|
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=
|
|
107
|
+
ok 17 - commit at detached HEAD saved to a branch # time=27.215ms
|
|
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=14.104ms
|
|
|
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=
|
|
117
|
+
ok 18 - commit --amend changes hash on message change even in detached HEAD # time=58.749ms
|
|
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 reject
|
|
4
4
|
1..1
|
|
5
|
-
ok 1 - merge with no commit fails # time=
|
|
5
|
+
ok 1 - merge with no commit fails # time=171.332ms
|
|
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=176.221ms
|
|
|
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=
|
|
14
|
+
ok 2 - merge fast-forward # time=25.959ms
|
|
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":"
|
|
4
|
+
ok 2 - invalid \# of change entries: [{"op":"add","path":"/nested/0","value":{"uuid":"293cebbb-9f78-45ee-a07a-735bdfc8a9f9","name":"new name"}},{"op":"add","path":"/nested/1","value":{"uuid":"8817b9e4-0baf-499e-8ce6-49ae3862d18f","name":"first name"}}]
|
|
5
5
|
1..2
|
|
6
|
-
ok 1 - diff is ok # time=
|
|
6
|
+
ok 1 - diff is ok # time=181.102ms
|
|
7
7
|
|
|
8
8
|
# Subtest: restore
|
|
9
9
|
# Subtest: history check
|
|
@@ -16,7 +16,7 @@ ok 1 - diff is ok # time=147.454ms
|
|
|
16
16
|
ok 7 - incorrect \# of commits
|
|
17
17
|
ok 8 - incorrect \# of changelog entries
|
|
18
18
|
1..8
|
|
19
|
-
ok 1 - history check # time=
|
|
19
|
+
ok 1 - history check # time=77.498ms
|
|
20
20
|
|
|
21
21
|
# Subtest: date stays date
|
|
22
22
|
ok 1 - incorrect \# of commits
|
|
@@ -24,7 +24,7 @@ ok 1 - diff is ok # time=147.454ms
|
|
|
24
24
|
ok 3 - restored object does not equal last version.
|
|
25
25
|
ok 4 - incorrect \# of changelog entries
|
|
26
26
|
1..4
|
|
27
|
-
ok 2 - date stays date # time=
|
|
27
|
+
ok 2 - date stays date # time=9.386ms
|
|
28
28
|
|
|
29
29
|
# Subtest: reconstruct with 2 commits
|
|
30
30
|
ok 1 - main is pointing at wrong commit
|
|
@@ -33,17 +33,17 @@ ok 1 - diff is ok # time=147.454ms
|
|
|
33
33
|
ok 4 - incorrect \# of commits
|
|
34
34
|
ok 5 - incorrect \# of changelog entries
|
|
35
35
|
1..5
|
|
36
|
-
ok 3 - reconstruct with 2 commits # time=8.
|
|
36
|
+
ok 3 - reconstruct with 2 commits # time=8.567ms
|
|
37
37
|
|
|
38
38
|
1..3
|
|
39
|
-
ok 2 - restore # time=
|
|
39
|
+
ok 2 - restore # time=134.232ms
|
|
40
40
|
|
|
41
41
|
# Subtest: history
|
|
42
42
|
# Subtest: successful restore
|
|
43
43
|
ok 1 - restored object does not equal last version.
|
|
44
44
|
ok 2 - should not be the js ref
|
|
45
45
|
1..2
|
|
46
|
-
ok 1 - successful restore # time=
|
|
46
|
+
ok 1 - successful restore # time=253.739ms
|
|
47
47
|
|
|
48
48
|
# Subtest: remoteRefs doesn't change on commit
|
|
49
49
|
ok 1 - input history refs and remote before change should not be the same object
|
|
@@ -52,7 +52,7 @@ ok 2 - restore # time=129.172ms
|
|
|
52
52
|
ok 4 - history refs must not be the same as static remotes
|
|
53
53
|
ok 5 - histories must not match anymore
|
|
54
54
|
1..5
|
|
55
|
-
ok 2 - remoteRefs doesn't change on commit # time=
|
|
55
|
+
ok 2 - remoteRefs doesn't change on commit # time=14.737ms
|
|
56
56
|
|
|
57
57
|
# Subtest: history contains HEAD ref
|
|
58
58
|
ok 1 - should be equal
|
|
@@ -60,15 +60,15 @@ ok 2 - restore # time=129.172ms
|
|
|
60
60
|
ok 3 - should be equal
|
|
61
61
|
ok 4 - should be equal
|
|
62
62
|
1..4
|
|
63
|
-
ok 3 - history contains HEAD ref # time=1.
|
|
63
|
+
ok 3 - history contains HEAD ref # time=1.192ms
|
|
64
64
|
|
|
65
65
|
# Subtest: empty history unreachable HEAD
|
|
66
66
|
ok 1 - expected to throw
|
|
67
67
|
1..1
|
|
68
|
-
ok 4 - empty history unreachable HEAD # time=1.
|
|
68
|
+
ok 4 - empty history unreachable HEAD # time=1.567ms
|
|
69
69
|
|
|
70
70
|
1..4
|
|
71
|
-
ok 3 - history # time=
|
|
71
|
+
ok 3 - history # time=339.06ms
|
|
72
72
|
|
|
73
73
|
# Subtest: reset
|
|
74
74
|
# Subtest: discard uncommitted changes
|
|
@@ -76,7 +76,7 @@ ok 3 - history # time=363.835ms
|
|
|
76
76
|
ok 2 - wrong \# of changes in diff
|
|
77
77
|
ok 3 - failed to reset
|
|
78
78
|
1..3
|
|
79
|
-
ok 1 - discard uncommitted changes # time=
|
|
79
|
+
ok 1 - discard uncommitted changes # time=158.972ms
|
|
80
80
|
|
|
81
81
|
# Subtest: reset to earlier commit
|
|
82
82
|
ok 1 - should be equal
|
|
@@ -86,7 +86,7 @@ ok 3 - history # time=363.835ms
|
|
|
86
86
|
ok 5 - failed to reset
|
|
87
87
|
ok 6 - main should point to first hash
|
|
88
88
|
1..6
|
|
89
|
-
ok 2 - reset to earlier commit # time=
|
|
89
|
+
ok 2 - reset to earlier commit # time=21.585ms
|
|
90
90
|
|
|
91
91
|
# Subtest: reset to earlier version tag
|
|
92
92
|
ok 1 - should be equal
|
|
@@ -96,54 +96,54 @@ ok 3 - history # time=363.835ms
|
|
|
96
96
|
ok 5 - failed to reset
|
|
97
97
|
ok 6 - main should point to first hash
|
|
98
98
|
1..6
|
|
99
|
-
ok 3 - reset to earlier version tag # time=
|
|
99
|
+
ok 3 - reset to earlier version tag # time=7.045ms
|
|
100
100
|
|
|
101
101
|
1..3
|
|
102
|
-
ok 4 - reset # time=
|
|
102
|
+
ok 4 - reset # time=259.271ms
|
|
103
103
|
|
|
104
104
|
# Subtest: status
|
|
105
105
|
# Subtest: clean repo no change
|
|
106
106
|
ok 1 - Shouldn't have pending changes
|
|
107
107
|
1..1
|
|
108
|
-
ok 1 - clean repo no change # time=
|
|
108
|
+
ok 1 - clean repo no change # time=437.377ms
|
|
109
109
|
|
|
110
110
|
# Subtest: clean repo pending change
|
|
111
111
|
ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
112
112
|
1..1
|
|
113
|
-
ok 2 - clean repo pending change # time=0.
|
|
113
|
+
ok 2 - clean repo pending change # time=0.764ms
|
|
114
114
|
|
|
115
115
|
# Subtest: reading status shouldn't clean observer
|
|
116
116
|
ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
117
117
|
ok 2 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
118
118
|
ok 3 - why different pending changes??
|
|
119
119
|
1..3
|
|
120
|
-
ok 3 - reading status shouldn't clean observer # time=1.
|
|
120
|
+
ok 3 - reading status shouldn't clean observer # time=1.248ms
|
|
121
121
|
|
|
122
122
|
# Subtest: after commit no change
|
|
123
123
|
ok 1 - Shouldn't have pending changes
|
|
124
124
|
1..1
|
|
125
|
-
ok 4 - after commit no change # time=
|
|
125
|
+
ok 4 - after commit no change # time=7.633ms
|
|
126
126
|
|
|
127
127
|
# Subtest: after commit pending change
|
|
128
128
|
ok 1 - Shouldn't have pending changes
|
|
129
129
|
ok 2 - Status doesn't contain changes
|
|
130
130
|
1..2
|
|
131
|
-
ok 5 - after commit pending change # time=
|
|
131
|
+
ok 5 - after commit pending change # time=4.985ms
|
|
132
132
|
|
|
133
133
|
# Subtest: after commit pending change for rewrite array
|
|
134
134
|
ok 1 - Shouldn't have pending changes
|
|
135
135
|
ok 2 - Status doesn't contain changes
|
|
136
136
|
1..2
|
|
137
|
-
ok 6 - after commit pending change for rewrite array # time=
|
|
137
|
+
ok 6 - after commit pending change for rewrite array # time=8.616ms
|
|
138
138
|
|
|
139
139
|
# Subtest: change of nested array element prop
|
|
140
140
|
ok 1 - Shouldn't have pending changes
|
|
141
141
|
ok 2 - Status doesn't contain changes
|
|
142
142
|
1..2
|
|
143
|
-
ok 7 - change of nested array element prop # time=
|
|
143
|
+
ok 7 - change of nested array element prop # time=3.596ms
|
|
144
144
|
|
|
145
145
|
1..7
|
|
146
|
-
ok 5 - status # time=
|
|
146
|
+
ok 5 - status # time=533.401ms
|
|
147
147
|
|
|
148
148
|
# Subtest: apply
|
|
149
149
|
# Subtest: single patch
|
|
@@ -153,7 +153,7 @@ ok 5 - status # time=556.196ms
|
|
|
153
153
|
ok 4 - Status doesn't contain changes
|
|
154
154
|
ok 5 - It should have the right changes
|
|
155
155
|
1..5
|
|
156
|
-
ok 1 - single patch # time=
|
|
156
|
+
ok 1 - single patch # time=163.461ms
|
|
157
157
|
|
|
158
158
|
# Subtest: patch for undefined props with workaround
|
|
159
159
|
ok 1 - Shouldn't have pending changes
|
|
@@ -161,7 +161,7 @@ ok 5 - status # time=556.196ms
|
|
|
161
161
|
ok 3 - The final state should match up
|
|
162
162
|
ok 4 - Status should contain 1 change
|
|
163
163
|
1..4
|
|
164
|
-
ok 2 - patch for undefined props with workaround # time=
|
|
164
|
+
ok 2 - patch for undefined props with workaround # time=2.697ms
|
|
165
165
|
|
|
166
166
|
# Subtest: multiple patches
|
|
167
167
|
ok 1 - Shouldn't have pending changes
|
|
@@ -170,10 +170,10 @@ ok 5 - status # time=556.196ms
|
|
|
170
170
|
ok 4 - It should have the right changes
|
|
171
171
|
ok 5 - The final state does not match up
|
|
172
172
|
1..5
|
|
173
|
-
ok 3 - multiple patches # time=
|
|
173
|
+
ok 3 - multiple patches # time=1.831ms
|
|
174
174
|
|
|
175
175
|
1..3
|
|
176
|
-
ok 6 - apply # time=
|
|
176
|
+
ok 6 - apply # time=234.711ms
|
|
177
177
|
|
|
178
178
|
# Subtest: pending changes - push helpers
|
|
179
179
|
# Subtest: 1 commit & 1 ref update
|
|
@@ -182,7 +182,7 @@ ok 6 - apply # time=235.891ms
|
|
|
182
182
|
ok 3 - wrong pending commit
|
|
183
183
|
ok 4 - wrong pending ref update
|
|
184
184
|
1..4
|
|
185
|
-
ok 1 - 1 commit & 1 ref update # time=
|
|
185
|
+
ok 1 - 1 commit & 1 ref update # time=632.334ms
|
|
186
186
|
|
|
187
187
|
# Subtest: 2 commit & 1 ref update
|
|
188
188
|
ok 1 - incorrect number of pending commits
|
|
@@ -190,7 +190,7 @@ ok 6 - apply # time=235.891ms
|
|
|
190
190
|
ok 3 - wrong pending commits
|
|
191
191
|
ok 4 - wrong pending ref update
|
|
192
192
|
1..4
|
|
193
|
-
ok 2 - 2 commit & 1 ref update # time=8.
|
|
193
|
+
ok 2 - 2 commit & 1 ref update # time=8.541ms
|
|
194
194
|
|
|
195
195
|
# Subtest: 1 commit & 2 ref updates
|
|
196
196
|
ok 1 - incorrect number of pending commits
|
|
@@ -198,7 +198,7 @@ ok 6 - apply # time=235.891ms
|
|
|
198
198
|
ok 3 - wrong pending commits
|
|
199
199
|
ok 4 - wrong pending ref update
|
|
200
200
|
1..4
|
|
201
|
-
ok 3 - 1 commit & 2 ref updates # time=
|
|
201
|
+
ok 3 - 1 commit & 2 ref updates # time=13.569ms
|
|
202
202
|
|
|
203
203
|
# Subtest: 2 commit & 2 ref updates
|
|
204
204
|
ok 1 - incorrect number of pending commits
|
|
@@ -206,7 +206,7 @@ ok 6 - apply # time=235.891ms
|
|
|
206
206
|
ok 3 - wrong pending commits
|
|
207
207
|
ok 4 - wrong pending ref update
|
|
208
208
|
1..4
|
|
209
|
-
ok 4 - 2 commit & 2 ref updates # time=
|
|
209
|
+
ok 4 - 2 commit & 2 ref updates # time=33.024ms
|
|
210
210
|
|
|
211
211
|
# Subtest: 3 commit & 2 ref updates
|
|
212
212
|
ok 1 - incorrect number of pending commits
|
|
@@ -214,7 +214,7 @@ ok 6 - apply # time=235.891ms
|
|
|
214
214
|
ok 3 - wrong pending commits
|
|
215
215
|
ok 4 - wrong pending ref update
|
|
216
216
|
1..4
|
|
217
|
-
ok 5 - 3 commit & 2 ref updates # time=
|
|
217
|
+
ok 5 - 3 commit & 2 ref updates # time=11.833ms
|
|
218
218
|
|
|
219
219
|
# Subtest: 3 commit & 3 ref updates
|
|
220
220
|
ok 1 - incorrect number of pending commits
|
|
@@ -222,7 +222,7 @@ ok 6 - apply # time=235.891ms
|
|
|
222
222
|
ok 3 - wrong pending commits
|
|
223
223
|
ok 4 - wrong pending ref update
|
|
224
224
|
1..4
|
|
225
|
-
ok 6 - 3 commit & 3 ref updates # time=11.
|
|
225
|
+
ok 6 - 3 commit & 3 ref updates # time=11.692ms
|
|
226
226
|
|
|
227
227
|
# Subtest: after merge 1 commit & 3 ref updates
|
|
228
228
|
ok 1 - incorrect number of pending commits
|
|
@@ -230,7 +230,7 @@ ok 6 - apply # time=235.891ms
|
|
|
230
230
|
ok 3 - wrong pending commits
|
|
231
231
|
ok 4 - wrong pending ref update
|
|
232
232
|
1..4
|
|
233
|
-
ok 7 - after merge 1 commit & 3 ref updates # time=10.
|
|
233
|
+
ok 7 - after merge 1 commit & 3 ref updates # time=10.797ms
|
|
234
234
|
|
|
235
235
|
# Subtest: after merge 1 commit & 2 ref updates
|
|
236
236
|
ok 1 - incorrect number of pending commits
|
|
@@ -238,7 +238,7 @@ ok 6 - apply # time=235.891ms
|
|
|
238
238
|
ok 3 - wrong pending commits
|
|
239
239
|
ok 4 - wrong pending ref update
|
|
240
240
|
1..4
|
|
241
|
-
ok 8 - after merge 1 commit & 2 ref updates # time=
|
|
241
|
+
ok 8 - after merge 1 commit & 2 ref updates # time=9.483ms
|
|
242
242
|
|
|
243
243
|
# Subtest: no merge 1 commit & 1 ref updates
|
|
244
244
|
ok 1 - incorrect number of pending commits
|
|
@@ -246,7 +246,7 @@ ok 6 - apply # time=235.891ms
|
|
|
246
246
|
ok 3 - wrong pending commits
|
|
247
247
|
ok 4 - wrong pending ref update
|
|
248
248
|
1..4
|
|
249
|
-
ok 9 - no merge 1 commit & 1 ref updates # time=5.
|
|
249
|
+
ok 9 - no merge 1 commit & 1 ref updates # time=5.398ms
|
|
250
250
|
|
|
251
251
|
# Subtest: no merge no commit & 1 ref updates
|
|
252
252
|
ok 1 - incorrect number of pending commits
|
|
@@ -254,7 +254,7 @@ ok 6 - apply # time=235.891ms
|
|
|
254
254
|
ok 3 - wrong pending commits
|
|
255
255
|
ok 4 - wrong pending ref update
|
|
256
256
|
1..4
|
|
257
|
-
ok 10 - no merge no commit & 1 ref updates # time=
|
|
257
|
+
ok 10 - no merge no commit & 1 ref updates # time=3.725ms
|
|
258
258
|
|
|
259
259
|
# Subtest: local remote state is updated after push
|
|
260
260
|
ok 1 - incorrect number of pending commits
|
|
@@ -264,9 +264,9 @@ ok 6 - apply # time=235.891ms
|
|
|
264
264
|
local remote state is updated after push
|
|
265
265
|
ok 5 - remote should be different after push
|
|
266
266
|
1..5
|
|
267
|
-
ok 11 - local remote state is updated after push # time=
|
|
267
|
+
ok 11 - local remote state is updated after push # time=5.175ms
|
|
268
268
|
|
|
269
269
|
1..11
|
|
270
|
-
ok 7 - pending changes - push helpers # time=
|
|
270
|
+
ok 7 - pending changes - push helpers # time=840.222ms
|
|
271
271
|
|
|
272
272
|
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=
|
|
5
|
+
ok 1 - cannot tag on an empty repo # time=32.148ms
|
|
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=
|
|
12
|
+
ok 2 - can create simple tag pointing to HEAD # time=100.589ms
|
|
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=
|
|
17
|
+
ok 3 - cannot create tag with whitespace # time=7.565ms
|
|
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=
|
|
6
|
+
ok 1 - author <email@domain.info> # time=3.785ms
|
|
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.
|
|
12
|
+
ok 2 - author with space <email@domain.info> # time=0.666ms
|
|
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.
|
|
18
|
+
ok 3 - author @handle # time=0.45ms
|
|
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.
|
|
24
|
+
ok 4 - author with space @handle # time=0.405ms
|
|
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.
|
|
30
|
+
ok 5 - email@domain.info # time=0.569ms
|
|
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.
|
|
36
|
+
ok 6 - @handle # time=0.612ms
|
|
37
37
|
|
|
38
38
|
# Subtest: empty author
|
|
39
39
|
ok 1 - expected to throw
|
|
40
40
|
1..1
|
|
41
|
-
ok 7 - empty author # time=2.
|
|
41
|
+
ok 7 - empty author # time=2.33ms
|
|
42
42
|
|
|
43
43
|
# Subtest: mapPath
|
|
44
44
|
# Subtest: find root
|
|
@@ -46,7 +46,7 @@ ok 7 - empty author # time=2.309ms
|
|
|
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=
|
|
49
|
+
ok 1 - find root # time=115.819ms
|
|
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=2.309ms
|
|
|
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=
|
|
57
|
+
ok 2 - finds full path to root # time=4.71ms
|
|
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=
|
|
63
|
+
ok 3 - parent-to-child no ancestor # time=4.017ms
|
|
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=2.309ms
|
|
|
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=
|
|
71
|
+
ok 4 - finds path across 2 branches # time=4.932ms
|
|
72
72
|
|
|
73
73
|
1..4
|
|
74
|
-
ok 8 - mapPath # time=
|
|
74
|
+
ok 8 - mapPath # time=148.136ms
|
|
75
75
|
|
|
76
76
|
1..8
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v0.15.4 (Tue Mar 24 2026)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- fix: tags shouldn't be moved with detached HEAD ([@nadilas](https://github.com/nadilas))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- [@nadilas](https://github.com/nadilas)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v0.15.3 (Sun Mar 15 2026)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- fix: replace observe/generate with snapshot compare to eliminate clearTimeout side effects ([@nadilas](https://github.com/nadilas))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- [@nadilas](https://github.com/nadilas)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v0.15.2 (Fri Mar 13 2026)
|
|
2
26
|
|
|
3
27
|
#### 🐛 Bug Fix
|
package/lib/repository.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare class Repository<T extends {
|
|
|
85
85
|
private readonly timestampFn;
|
|
86
86
|
private remoteRefs;
|
|
87
87
|
private remoteCommits;
|
|
88
|
-
private
|
|
88
|
+
private _snapshot;
|
|
89
89
|
private readonly refs;
|
|
90
90
|
private readonly commits;
|
|
91
91
|
push(pushToBackendFn: () => Promise<boolean>): Promise<boolean>;
|
package/lib/repository.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { applyPatch, compare, deepClone,
|
|
2
|
-
import { brancheNameToRef, cleanRefValue, commitAtRefIn, createHeadRefValue, getLastRefPathElement, headValueRefPrefix, immutableArrayCopy, immutableMapCopy, refKeysAtCommit, localHeadPathPrefix, mapPath, mutableMapCopy, REFS_HEAD_KEY, REFS_MAIN_KEY, shaishToCommit, tagToRef, validateBranchName, validateRef, } from "./utils.js";
|
|
1
|
+
import { applyPatch, compare, deepClone, JsonPatchError, validate, } from "fast-json-patch";
|
|
2
|
+
import { brancheNameToRef, cleanRefValue, commitAtRefIn, createHeadRefValue, getLastRefPathElement, headValueRefPrefix, immutableArrayCopy, immutableMapCopy, refKeysAtCommit, localHeadPathPrefix, mapPath, mutableMapCopy, REFS_HEAD_KEY, REFS_MAIN_KEY, shaishToCommit, isTagRef, tagToRef, validateBranchName, validateRef, } from "./utils.js";
|
|
3
3
|
import * as jsondiffpatch from 'jsondiffpatch';
|
|
4
4
|
/**
|
|
5
5
|
* A repository recording and managing the state transitions of an object
|
|
@@ -18,7 +18,7 @@ export class Repository {
|
|
|
18
18
|
this.original = deepClone(obj);
|
|
19
19
|
// store js ref, so obj can still be modified without going through repo.data
|
|
20
20
|
this.data = obj;
|
|
21
|
-
this.
|
|
21
|
+
this._snapshot = deepClone(obj);
|
|
22
22
|
this.refs = ((_e = options.history) === null || _e === void 0 ? void 0 : _e.refs)
|
|
23
23
|
? mutableMapCopy((_f = options.history) === null || _f === void 0 ? void 0 : _f.refs)
|
|
24
24
|
: new Map([
|
|
@@ -152,9 +152,8 @@ export class Repository {
|
|
|
152
152
|
if (!patchToTarget) {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
this.observer.unobserve();
|
|
156
155
|
jsondiffpatch.patch(this.data, patchToTarget);
|
|
157
|
-
this.
|
|
156
|
+
this._snapshot = deepClone(this.data);
|
|
158
157
|
}
|
|
159
158
|
// FIXME: refactor this to use jsondiffpatch delta instead of json-patch for advanced type support
|
|
160
159
|
apply(patch) {
|
|
@@ -190,9 +189,6 @@ export class Repository {
|
|
|
190
189
|
// const changed = patch.reduce(applyReducer, this.data);
|
|
191
190
|
}
|
|
192
191
|
async reset(mode = "hard", shaish = REFS_HEAD_KEY) {
|
|
193
|
-
if (mode === "hard") {
|
|
194
|
-
unobserve(this.data, this.observer);
|
|
195
|
-
}
|
|
196
192
|
const [commit] = shaishToCommit(shaish, this.refs, this.commits);
|
|
197
193
|
await this.moveTo(commit);
|
|
198
194
|
const commitAtHEAD = this.mustCommitAtHead();
|
|
@@ -202,9 +198,6 @@ export class Repository {
|
|
|
202
198
|
for (const ref of moveableRefs) {
|
|
203
199
|
this.moveRef(ref, commit);
|
|
204
200
|
}
|
|
205
|
-
if (mode === "hard") {
|
|
206
|
-
this.observer = observe(this.data);
|
|
207
|
-
}
|
|
208
201
|
}
|
|
209
202
|
branch() {
|
|
210
203
|
const currentHeadRef = this.refs.get(REFS_HEAD_KEY);
|
|
@@ -256,7 +249,9 @@ export class Repository {
|
|
|
256
249
|
else {
|
|
257
250
|
const [commit, isRef, refKey] = shaishToCommit(shaish, this.refs, this.commits);
|
|
258
251
|
await this.moveTo(commit);
|
|
259
|
-
|
|
252
|
+
// Only follow branch refs. Tags produce detached HEAD (like git).
|
|
253
|
+
const isBranchRef = isRef && refKey !== undefined && !isTagRef(refKey);
|
|
254
|
+
this.moveRef(REFS_HEAD_KEY, isBranchRef ? refKey : commit);
|
|
260
255
|
}
|
|
261
256
|
}
|
|
262
257
|
async commit(message, author, amend) {
|
|
@@ -272,12 +267,12 @@ export class Repository {
|
|
|
272
267
|
: [parent]; // we are the very first commit in the repository
|
|
273
268
|
}
|
|
274
269
|
}
|
|
275
|
-
|
|
276
|
-
const patch = generate(this.observer);
|
|
270
|
+
const patch = compare(this._snapshot, this.data);
|
|
277
271
|
if ((patch.length === 0 && !amend) ||
|
|
278
272
|
(amend && message === (parent === null || parent === void 0 ? void 0 : parent.message))) {
|
|
279
273
|
throw new Error(`no changes to commit`);
|
|
280
274
|
}
|
|
275
|
+
this._snapshot = deepClone(this.data);
|
|
281
276
|
const timestamp = this.timestampFn ? this.timestampFn() : new Date();
|
|
282
277
|
const parentChanges = amend && parent && ((_b = (_a = parent.changes) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0)
|
|
283
278
|
? parent.changes
|
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.15.
|
|
7
|
+
"version": "0.15.4",
|
|
8
8
|
"description": "Git-like repository for in-memory object versioning",
|
|
9
9
|
"private": false,
|
|
10
10
|
"main": "lib/index.js",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/",
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "603470971151a33246e87fff83410e61a46364d4"
|
|
53
53
|
}
|