@secrez/fs 1.1.1 → 1.1.2
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/coverage.report +186 -129
- package/package.json +3 -3
- package/src/GitConflictChecker.js +26 -7
- package/src/InternalFs.js +19 -4
package/coverage.report
CHANGED
|
@@ -1,203 +1,260 @@
|
|
|
1
|
+
WARN Unsupported engine: wanted: {"node":">=22.23.4"} (current: {"node":"v22.14.0","pnpm":"9.6.0"})
|
|
1
2
|
|
|
2
|
-
> @secrez/fs@1.
|
|
3
|
+
> @secrez/fs@1.1.2 test /Users/francescosullo/Projects/Secrez/secrez/packages/fs
|
|
3
4
|
> cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js --exit
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
#DataCache
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
✔ should initialize a dataCache
|
|
10
|
+
✔ should put and get data
|
|
11
|
+
✔ should load data from disk, if any
|
|
12
|
+
✔ should not load if no data
|
|
13
|
+
✔ should load plaintext data from disk, if any
|
|
14
|
+
✔ should load encrypted data from disk, if any
|
|
14
15
|
|
|
15
16
|
#ExternalFs
|
|
16
17
|
getNormalizedPath
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
✔ should normalize "~/fileSystems"
|
|
19
|
+
✔ should normalize "~"
|
|
20
|
+
✔ should normalize "/var"
|
|
20
21
|
fileCompletion
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
✔ should return a list of files
|
|
23
|
+
✔ should return a list of only directories
|
|
24
|
+
✔ should return a list of only files
|
|
25
|
+
✔ should return the file itself, if it is not a directory
|
|
26
|
+
✔ should return the list of the files satisfying wildcards
|
|
27
|
+
✔ should return an empty list if the files does not exist
|
|
27
28
|
getVersionedBasename
|
|
28
|
-
|
|
29
|
+
✔ should version a file
|
|
29
30
|
isDir
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
✔ should confirm that "utils" is a dir
|
|
32
|
+
✔ should return that "config.test.js" is not a dir
|
|
33
|
+
✔ should return that a not-existent file is not a dir
|
|
33
34
|
isFile
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
✔ should return that "config.test.js" is a file
|
|
36
|
+
✔ should confirm that "utils" is not a file
|
|
37
|
+
✔ should return that a not-existent file is not a dir
|
|
37
38
|
|
|
38
39
|
#FileCipher
|
|
39
40
|
encrypt/decrypt external file
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
✔ should encrypt a file using a specific password (v2)
|
|
42
|
+
✔ should decrypt v1 password-encrypted files
|
|
43
|
+
✔ should encrypt a file using a shared key
|
|
44
|
+
✔ should encrypt a file using user's own public key
|
|
43
45
|
|
|
44
46
|
#FsUtils
|
|
45
47
|
preParseCommandLine
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
✔ should preParse a command line
|
|
49
|
+
✔ should preParse a command line with escaped pars
|
|
50
|
+
✔ should preParse a command line using quotes for params
|
|
49
51
|
parseCommandLine
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
✔ should parse a command line with definitions
|
|
53
|
+
✔ should return a {} w/out definitions
|
|
54
|
+
✔ should return a {} w/out params
|
|
55
|
+
✔ should return an _unknown if not supported option is passed
|
|
54
56
|
filterLs
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
✔ should filter an array of files and return itself
|
|
58
|
+
✔ should filter an array of files starting from "te"
|
|
59
|
+
✔ should filter an array of files of type .log
|
|
60
|
+
✔ should filter an array of files and find the folders
|
|
61
|
+
✔ should get all the files
|
|
62
|
+
✔ should return an empty array if nothing is found
|
|
63
|
+
✔ should return an empty array if parameters are missed or empty
|
|
64
|
+
✔ should return all the list array if files are missed
|
|
63
65
|
|
|
64
66
|
#GitConflictChecker
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
✔ should detect non-git repository
|
|
68
|
+
✔ should return null status for non-git repository
|
|
69
|
+
1) should reuse a hard block without checking git again
|
|
70
|
+
2) should reuse a behind-remote warning without checking git again
|
|
71
|
+
✔ should fetch again after a push refreshes the fingerprint
|
|
72
|
+
✔ should use the login fingerprint without fetching again
|
|
73
|
+
3) should check git again when the risk can be bypassed
|
|
74
|
+
✔ should not detect conflict risk in non-git repository
|
|
75
|
+
with local git repository
|
|
76
|
+
✔ should detect git repository
|
|
77
|
+
✔ should get git status when up to date with remote (153ms)
|
|
78
|
+
✔ should detect conflict risk when behind remote (281ms)
|
|
79
|
+
✔ should get warning message for conflict risk
|
|
80
|
+
✔ should not show alert again after user proceeds (154ms)
|
|
81
|
+
✔ should reset cache
|
|
75
82
|
|
|
76
83
|
#InternalFs
|
|
77
84
|
#constructor
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
✔ should instantiate the internal file system and initialize it
|
|
86
|
+
✔ should initialize the internal fs
|
|
87
|
+
✔ should throw if passing not a Secrez instance
|
|
81
88
|
getFullPath
|
|
82
|
-
|
|
89
|
+
✔ should return the fullPath of an entry
|
|
83
90
|
normalizePath
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
✔ should normalize a path
|
|
92
|
+
✔ should throw if the path is empty, is not a string or is longer than 255 chars
|
|
86
93
|
getNormalizedPath
|
|
87
|
-
|
|
94
|
+
✔ should normalize a path
|
|
88
95
|
make
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
✔ should create directories and files
|
|
97
|
+
✔ should throw trying to re-add the same entry
|
|
91
98
|
change
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
✔ should create directories and files and update them
|
|
100
|
+
✔ should return an error
|
|
101
|
+
✔ should move files between datasets
|
|
95
102
|
remove
|
|
96
|
-
|
|
103
|
+
✔ should remove a file from the tree
|
|
97
104
|
load
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
✔ should create directories and files and loading a tree from disk
|
|
106
|
+
✔ should create directories and files, and load a tree from disk
|
|
107
|
+
✔ should create directories and files, delete everything and loading a tree from disk
|
|
108
|
+
✔ should compress and reload an empty set of entries
|
|
102
109
|
#getFileList
|
|
103
|
-
|
|
110
|
+
✔ should get the current folder dir
|
|
104
111
|
|
|
105
112
|
#Node
|
|
106
113
|
#constructor
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
✔ should instantiate the Node
|
|
115
|
+
✔ should throw if passing a rot without required parameters
|
|
116
|
+
✔ should throw if not passing an object
|
|
117
|
+
✔ should throw if not passing wrong type
|
|
111
118
|
#getName && #getFile && #getContent && getOptions
|
|
112
|
-
|
|
113
|
-
|
|
119
|
+
✔ should get name, file and options
|
|
120
|
+
✔ should throw if version not found
|
|
114
121
|
#getFindRe
|
|
115
|
-
|
|
122
|
+
✔ should get a re to check a filepath
|
|
116
123
|
#getNames
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
✔ should get the names of all children
|
|
125
|
+
✔ should throw if trying to get children of a file
|
|
119
126
|
#find
|
|
120
|
-
|
|
127
|
+
✔ should find all childrens satisfying criterias
|
|
121
128
|
#add
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
✔ should add children to root
|
|
130
|
+
✔ should throw if node is a file
|
|
124
131
|
#move
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
✔ should rename a node
|
|
133
|
+
✔ should move a node
|
|
134
|
+
✔ should throw trying to move root
|
|
135
|
+
✔ should throw trying to modify a node with different id
|
|
129
136
|
#remove
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
137
|
+
✔ should remove a node
|
|
138
|
+
✔ should remove itself
|
|
139
|
+
✔ should throw trying to remove root
|
|
133
140
|
#toCompressedJSON && Node#fromJSON
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
✔ should prepare a json for saving
|
|
142
|
+
✔ should build an index from a json file
|
|
136
143
|
#getChildFromPath
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
✔ should find a node starting from a path
|
|
145
|
+
✔ should find the last ancestor starting from a path
|
|
146
|
+
✔ should throw if the path is incorrect or does not exist
|
|
147
|
+
✔ should throw if looking for last ancestor and find existent node
|
|
141
148
|
#getPathToChild
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
✔ should find a node starting from a path
|
|
150
|
+
✔ should throw if child is not a Node
|
|
151
|
+
✔ should throw if child belows to another tree
|
|
145
152
|
#findDirectChildByName && #findChildById
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
✔ should find a direct child by name and by id
|
|
154
|
+
✔ should throw if looking for child of a file
|
|
155
|
+
✔ should throw if looking for child of a file
|
|
149
156
|
|
|
150
157
|
#Tree
|
|
151
158
|
#constructor
|
|
152
|
-
|
|
153
|
-
|
|
159
|
+
✔ should instantiate the Tree
|
|
160
|
+
✔ should throw if passing not an Secrez instance
|
|
154
161
|
#load
|
|
155
|
-
|
|
156
|
-
|
|
162
|
+
✔ should load an empty Tree
|
|
163
|
+
✔ should do nothing if already loaded
|
|
157
164
|
getEntryDetails
|
|
158
|
-
|
|
165
|
+
✔ should return the entry details of a node
|
|
159
166
|
#Fix
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
✔ should load a tree with tags
|
|
168
|
+
✔ should simulate a conflict in the repo and recover lost entries when a valid tree exists (1116ms)
|
|
169
|
+
✔ should simulate a lost index in the repo and recover the entries when no valid tree is found (44ms)
|
|
163
170
|
Multi data sets
|
|
164
|
-
|
|
171
|
+
✔ should load the trees of two data sets
|
|
165
172
|
|
|
166
173
|
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
110 passing (4s)
|
|
175
|
+
3 failing
|
|
169
176
|
|
|
170
|
-
1) #
|
|
171
|
-
|
|
172
|
-
should simulate a conflict in the repo and recover lost entries when a valid tree exists:
|
|
177
|
+
1) #GitConflictChecker
|
|
178
|
+
should reuse a hard block without checking git again:
|
|
173
179
|
|
|
174
|
-
AssertionError: expected
|
|
180
|
+
AssertionError: expected { hasRisk: true, …(4) } to equal { Object (hasRisk, riskType, ...) }
|
|
175
181
|
+ expected - actual
|
|
176
182
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
- "
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
{
|
|
184
|
+
- "allowBypass": false
|
|
185
|
+
- "hasRisk": true
|
|
186
|
+
- "message": "🚫 Repository State Changed Externally!\n \nThe git repository state has changed since you entered your account.\nThis likely means a 'git pull' or other git operation was performed in another terminal.\n\nSecrez cannot safely read these changes while running.\nFor data integrity, only READ operations and QUIT are allowed."
|
|
187
|
+
- "riskType": "external_change"
|
|
188
|
+
- "status": {
|
|
189
|
+
- "ahead": 0
|
|
190
|
+
- "behind": 0
|
|
191
|
+
- "headCommit": "abc"
|
|
192
|
+
- "localBranch": "main"
|
|
193
|
+
- "remoteBranch": "origin/main"
|
|
194
|
+
- "uncommitted": 0
|
|
195
|
+
- }
|
|
196
|
+
+ "allowBypass": true
|
|
197
|
+
+ "hasRisk": false
|
|
198
|
+
+ "message": [null]
|
|
199
|
+
+ "riskType": [null]
|
|
200
|
+
+ "status": [null]
|
|
201
|
+
}
|
|
184
202
|
|
|
185
|
-
at Context.<anonymous> (test/
|
|
203
|
+
at Context.<anonymous> (test/GitConflictChecker.test.js:91:12)
|
|
204
|
+
|
|
205
|
+
2) #GitConflictChecker
|
|
206
|
+
should reuse a behind-remote warning without checking git again:
|
|
207
|
+
|
|
208
|
+
AssertionError: expected { hasRisk: true, …(4) } to equal { Object (hasRisk, riskType, ...) }
|
|
209
|
+
+ expected - actual
|
|
210
|
+
|
|
211
|
+
{
|
|
212
|
+
"allowBypass": true
|
|
213
|
+
- "hasRisk": true
|
|
214
|
+
- "message": "⚠️ Git Conflict Risk Detected!\n \nYour local repository is 1 commit(s) behind the remote 'origin/main' branch.\nAny changes you make now could lead to merge conflicts when you try to sync later."
|
|
215
|
+
- "riskType": "behind_remote"
|
|
216
|
+
- "status": {
|
|
217
|
+
- "ahead": 0
|
|
218
|
+
- "behind": 1
|
|
219
|
+
- "headCommit": "abc"
|
|
220
|
+
- "localBranch": "main"
|
|
221
|
+
- "remoteBranch": "origin/main"
|
|
222
|
+
- "uncommitted": 0
|
|
223
|
+
- }
|
|
224
|
+
+ "hasRisk": false
|
|
225
|
+
+ "message": [null]
|
|
226
|
+
+ "riskType": [null]
|
|
227
|
+
+ "status": [null]
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
at Context.<anonymous> (test/GitConflictChecker.test.js:117:12)
|
|
231
|
+
|
|
232
|
+
3) #GitConflictChecker
|
|
233
|
+
should check git again when the risk can be bypassed:
|
|
234
|
+
|
|
235
|
+
AssertionError: expected 1 to equal 2
|
|
236
|
+
+ expected - actual
|
|
237
|
+
|
|
238
|
+
-1
|
|
239
|
+
+2
|
|
240
|
+
|
|
241
|
+
at Context.<anonymous> (test/GitConflictChecker.test.js:187:12)
|
|
186
242
|
|
|
187
243
|
|
|
188
244
|
|
|
189
245
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
|
190
246
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
191
247
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
|
192
|
-
All files |
|
|
193
|
-
DataCache.js | 89.
|
|
248
|
+
All files | 83.39 | 70.34 | 88.19 | 83.09 |
|
|
249
|
+
DataCache.js | 89.53 | 74.07 | 90.9 | 89.41 | 18-24,123-124,150
|
|
194
250
|
ExternalFs.js | 94.02 | 76.92 | 100 | 93.93 | 9,29,35,54
|
|
195
|
-
FileCipher.js | 88.
|
|
251
|
+
FileCipher.js | 88.05 | 73.8 | 100 | 88.05 | 9,39,76,85,91,95,131,136
|
|
196
252
|
FsUtils.js | 100 | 100 | 100 | 100 |
|
|
197
|
-
GitConflictChecker.js |
|
|
198
|
-
InternalFs.js |
|
|
253
|
+
GitConflictChecker.js | 84.87 | 79.81 | 100 | 84.87 | ...89,199,202,212,215,224,242,323
|
|
254
|
+
InternalFs.js | 87.5 | 73.5 | 88.88 | 87.4 | ...88,333,344,364,423-428,460,471
|
|
199
255
|
Messages.js | 100 | 100 | 100 | 100 |
|
|
200
256
|
Node.js | 66.1 | 54.81 | 78.72 | 65.31 | ...05,644-648,666,669,683-720,729
|
|
201
|
-
Tree.js |
|
|
257
|
+
Tree.js | 89.91 | 74.09 | 86.48 | 89.63 | ...44,471,481,535,627,635,666-677
|
|
258
|
+
fileCipherLegacy.js | 100 | 100 | 100 | 100 |
|
|
202
259
|
-----------------------|---------|----------|---------|---------|-----------------------------------
|
|
203
260
|
ELIFECYCLE Test failed. See above for more details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secrez/fs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@secrez/core": "~1.1.1",
|
|
10
10
|
"@secrez/crypto": "~1.1.1",
|
|
11
|
-
"@secrez/utils": "~1.1.
|
|
11
|
+
"@secrez/utils": "~1.1.2",
|
|
12
12
|
"command-line-args": "^5.2.1",
|
|
13
13
|
"fs-extra": "^9.1.0",
|
|
14
14
|
"lodash": "^4.17.21"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@secrez/test-helpers": "~2.0.
|
|
17
|
+
"@secrez/test-helpers": "~2.0.5",
|
|
18
18
|
"chai": "^4.5.0",
|
|
19
19
|
"cross-env": "^7.0.3",
|
|
20
20
|
"mocha": "^10.8.2",
|
|
@@ -8,6 +8,10 @@ class GitConflictChecker {
|
|
|
8
8
|
this.isGitRepo = null;
|
|
9
9
|
this.remoteStatus = null;
|
|
10
10
|
this.initialGitState = null; // Initial state captured at account entry
|
|
11
|
+
this.sessionBlock = null; // Known repo risk kept until Secrez is restarted
|
|
12
|
+
this.sessionBlockAnnounced = false;
|
|
13
|
+
this.entryStatus = null;
|
|
14
|
+
this.hasEntryStatus = false;
|
|
11
15
|
this.lastCheck = null;
|
|
12
16
|
this.checkInterval = 30000; // 30 seconds between checks
|
|
13
17
|
}
|
|
@@ -36,6 +40,22 @@ class GitConflictChecker {
|
|
|
36
40
|
*/
|
|
37
41
|
async captureInitialState() {
|
|
38
42
|
const status = await this.getGitStatus();
|
|
43
|
+
this.entryStatus = status;
|
|
44
|
+
this.hasEntryStatus = true;
|
|
45
|
+
if (status && !status.error) {
|
|
46
|
+
this.initialGitState = this.getGitFingerprint(status);
|
|
47
|
+
}
|
|
48
|
+
return status;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Remember the repo after a push Secrez just made.
|
|
53
|
+
* The next write must fetch again: a commit can land on the remote after this.
|
|
54
|
+
*/
|
|
55
|
+
async refreshFingerprint() {
|
|
56
|
+
const status = await this.getGitStatus();
|
|
57
|
+
this.entryStatus = null;
|
|
58
|
+
this.hasEntryStatus = false;
|
|
39
59
|
if (status && !status.error) {
|
|
40
60
|
this.initialGitState = this.getGitFingerprint(status);
|
|
41
61
|
}
|
|
@@ -280,9 +300,7 @@ The git repository state has changed since you entered your account.
|
|
|
280
300
|
This likely means a 'git pull' or other git operation was performed in another terminal.
|
|
281
301
|
|
|
282
302
|
Secrez cannot safely read these changes while running.
|
|
283
|
-
For data integrity, only READ operations and QUIT are allowed
|
|
284
|
-
|
|
285
|
-
Please quit Secrez and re-enter your account to sync with the new repository state.`;
|
|
303
|
+
For data integrity, only READ operations and QUIT are allowed.`;
|
|
286
304
|
}
|
|
287
305
|
|
|
288
306
|
if (status.error) {
|
|
@@ -299,10 +317,7 @@ Any changes you make now might conflict with remote changes that we cannot detec
|
|
|
299
317
|
return `⚠️ Git Conflict Risk Detected!
|
|
300
318
|
|
|
301
319
|
Your local repository is ${status.behind} commit(s) behind the remote '${status.remoteBranch}' branch.
|
|
302
|
-
Any changes you make now could lead to merge conflicts when you try to sync later
|
|
303
|
-
|
|
304
|
-
Consider quitting Secrez and running in the container:
|
|
305
|
-
git pull # to sync with remote changes first`;
|
|
320
|
+
Any changes you make now could lead to merge conflicts when you try to sync later.`;
|
|
306
321
|
}
|
|
307
322
|
|
|
308
323
|
return null;
|
|
@@ -315,6 +330,10 @@ Consider quitting Secrez and running in the container:
|
|
|
315
330
|
this.isGitRepo = null;
|
|
316
331
|
this.remoteStatus = null;
|
|
317
332
|
this.initialGitState = null;
|
|
333
|
+
this.sessionBlock = null;
|
|
334
|
+
this.sessionBlockAnnounced = false;
|
|
335
|
+
this.entryStatus = null;
|
|
336
|
+
this.hasEntryStatus = false;
|
|
318
337
|
this.lastCheck = null;
|
|
319
338
|
}
|
|
320
339
|
}
|
package/src/InternalFs.js
CHANGED
|
@@ -465,9 +465,20 @@ class InternalFs {
|
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
async checkGitSyncStatus() {
|
|
468
|
-
//
|
|
469
|
-
//
|
|
470
|
-
|
|
468
|
+
// Behind-remote and a hard block stay true until Secrez restarts, so later
|
|
469
|
+
// writes reuse the result instead of fetching again.
|
|
470
|
+
if (this.gitConflictChecker.sessionBlock) {
|
|
471
|
+
return this.gitConflictChecker.sessionBlock;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
let currentStatus;
|
|
475
|
+
if (this.gitConflictChecker.hasEntryStatus) {
|
|
476
|
+
currentStatus = this.gitConflictChecker.entryStatus;
|
|
477
|
+
this.gitConflictChecker.hasEntryStatus = false;
|
|
478
|
+
this.gitConflictChecker.entryStatus = null;
|
|
479
|
+
} else {
|
|
480
|
+
currentStatus = await this.gitConflictChecker.getGitStatus();
|
|
481
|
+
}
|
|
471
482
|
const riskInfo = this.gitConflictChecker.hasConflictRisk(currentStatus);
|
|
472
483
|
|
|
473
484
|
if (riskInfo.hasRisk) {
|
|
@@ -475,13 +486,17 @@ class InternalFs {
|
|
|
475
486
|
currentStatus,
|
|
476
487
|
riskInfo
|
|
477
488
|
);
|
|
478
|
-
|
|
489
|
+
const result = {
|
|
479
490
|
hasRisk: true,
|
|
480
491
|
riskType: riskInfo.type,
|
|
481
492
|
allowBypass: riskInfo.allowBypass,
|
|
482
493
|
message: warningMessage,
|
|
483
494
|
status: currentStatus,
|
|
484
495
|
};
|
|
496
|
+
if (riskInfo.allowBypass === false || riskInfo.type === "behind_remote") {
|
|
497
|
+
this.gitConflictChecker.sessionBlock = result;
|
|
498
|
+
}
|
|
499
|
+
return result;
|
|
485
500
|
}
|
|
486
501
|
|
|
487
502
|
return {
|