@openvcs/git-plugin 0.2.0-edge.20260508.59 → 0.2.0-edge.20260510.62
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.
|
@@ -7,6 +7,11 @@ import { GitCommand } from './git.js';
|
|
|
7
7
|
function asOptionalBoolean(value) {
|
|
8
8
|
return typeof value === 'boolean' ? value : undefined;
|
|
9
9
|
}
|
|
10
|
+
/** Splits Git diff stdout into lines without manufacturing a blank entry for empty output. */
|
|
11
|
+
function splitDiffLines(output) {
|
|
12
|
+
const normalized = output.trimEnd();
|
|
13
|
+
return normalized.length > 0 ? normalized.split('\n') : [];
|
|
14
|
+
}
|
|
10
15
|
/** Reduces a file status string to the primary status code needed for discard routing. */
|
|
11
16
|
function getPrimaryDiscardStatus(status) {
|
|
12
17
|
const normalized = asTrimmedString(status);
|
|
@@ -260,11 +265,11 @@ export class GitVcsDelegates extends VcsDelegateBase {
|
|
|
260
265
|
}
|
|
261
266
|
diffFile(params, _context) {
|
|
262
267
|
const git = this.requireGit(params.session_id);
|
|
263
|
-
return git.diffFile(asTrimmedString(params.path))
|
|
268
|
+
return splitDiffLines(git.diffFile(asTrimmedString(params.path)));
|
|
264
269
|
}
|
|
265
270
|
diffCommit(params, _context) {
|
|
266
271
|
const git = this.requireGit(params.session_id);
|
|
267
|
-
return git.diffCommit(asTrimmedString(params.rev))
|
|
272
|
+
return splitDiffLines(git.diffCommit(asTrimmedString(params.rev)));
|
|
268
273
|
}
|
|
269
274
|
getConflictDetails(params, _context) {
|
|
270
275
|
const git = this.requireGit(params.session_id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openvcs/git-plugin",
|
|
3
|
-
"version": "0.2.0-edge.
|
|
3
|
+
"version": "0.2.0-edge.20260510.62",
|
|
4
4
|
"description": "OpenVCS Git plugin - Node.js runtime",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"homepage": "https://github.com/Open-VCS/OpenVCS-Plugin-Git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"openvcs": {
|
|
19
19
|
"id": "openvcs.git",
|
|
20
20
|
"name": "Git",
|
|
21
|
-
"version": "0.2.0-edge.
|
|
21
|
+
"version": "0.2.0-edge.20260510.62",
|
|
22
22
|
"author": "OpenVCS Contributors",
|
|
23
23
|
"description": "Git VCS backend plugin for OpenVCS",
|
|
24
24
|
"default_enabled": true,
|
|
@@ -35,6 +35,12 @@ function asOptionalBoolean(value: unknown): boolean | undefined {
|
|
|
35
35
|
return typeof value === 'boolean' ? value : undefined;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** Splits Git diff stdout into lines without manufacturing a blank entry for empty output. */
|
|
39
|
+
function splitDiffLines(output: string): string[] {
|
|
40
|
+
const normalized = output.trimEnd();
|
|
41
|
+
return normalized.length > 0 ? normalized.split('\n') : [];
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
/** Reduces a file status string to the primary status code needed for discard routing. */
|
|
39
45
|
function getPrimaryDiscardStatus(status: string): string {
|
|
40
46
|
const normalized = asTrimmedString(status);
|
|
@@ -424,7 +430,7 @@ export class GitVcsDelegates extends VcsDelegateBase<GitRuntimeDependencies> {
|
|
|
424
430
|
_context: PluginRuntimeContext,
|
|
425
431
|
): string[] {
|
|
426
432
|
const git = this.requireGit(params.session_id);
|
|
427
|
-
return git.diffFile(asTrimmedString(params.path))
|
|
433
|
+
return splitDiffLines(git.diffFile(asTrimmedString(params.path)));
|
|
428
434
|
}
|
|
429
435
|
|
|
430
436
|
override diffCommit(
|
|
@@ -432,7 +438,7 @@ export class GitVcsDelegates extends VcsDelegateBase<GitRuntimeDependencies> {
|
|
|
432
438
|
_context: PluginRuntimeContext,
|
|
433
439
|
): string[] {
|
|
434
440
|
const git = this.requireGit(params.session_id);
|
|
435
|
-
return git.diffCommit(asTrimmedString(params.rev))
|
|
441
|
+
return splitDiffLines(git.diffCommit(asTrimmedString(params.rev)));
|
|
436
442
|
}
|
|
437
443
|
|
|
438
444
|
override getConflictDetails(
|