@openvcs/git-plugin 0.2.0-nightly.20260507.56 → 0.2.0-nightly.20260509.60
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/bin/plugin-helpers.js
CHANGED
|
@@ -83,6 +83,7 @@ export function parseStatusOutput(output) {
|
|
|
83
83
|
const records = output.split('\0').filter(Boolean);
|
|
84
84
|
let ahead = 0;
|
|
85
85
|
let behind = 0;
|
|
86
|
+
let branchOnRemote = false;
|
|
86
87
|
const files = [];
|
|
87
88
|
const summary = {
|
|
88
89
|
untracked: 0,
|
|
@@ -97,6 +98,8 @@ export function parseStatusOutput(output) {
|
|
|
97
98
|
const behindMatch = record.match(/behind\s+(\d+)/);
|
|
98
99
|
ahead = aheadMatch ? Number(aheadMatch[1]) : 0;
|
|
99
100
|
behind = behindMatch ? Number(behindMatch[1]) : 0;
|
|
101
|
+
const trackingMatch = record.match(/^## [^ ]+\.\.\.\S+/);
|
|
102
|
+
branchOnRemote = !!trackingMatch;
|
|
100
103
|
continue;
|
|
101
104
|
}
|
|
102
105
|
if (record.length < 4) {
|
|
@@ -147,6 +150,7 @@ export function parseStatusOutput(output) {
|
|
|
147
150
|
files,
|
|
148
151
|
ahead,
|
|
149
152
|
behind,
|
|
153
|
+
branch_on_remote: branchOnRemote,
|
|
150
154
|
},
|
|
151
155
|
};
|
|
152
156
|
}
|
|
@@ -159,7 +159,15 @@ export class GitVcsDelegates extends VcsDelegateBase {
|
|
|
159
159
|
}
|
|
160
160
|
createBranch(params, _context) {
|
|
161
161
|
const git = this.requireGit(params.session_id);
|
|
162
|
-
|
|
162
|
+
const name = asTrimmedString(params.name);
|
|
163
|
+
const checkout = params.checkout === true;
|
|
164
|
+
if (checkout) {
|
|
165
|
+
git.createBranch(name);
|
|
166
|
+
git.checkoutBranch(name);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
git.createBranch(name);
|
|
170
|
+
}
|
|
163
171
|
return null;
|
|
164
172
|
}
|
|
165
173
|
checkoutBranch(params, _context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openvcs/git-plugin",
|
|
3
|
-
"version": "0.2.0-nightly.
|
|
3
|
+
"version": "0.2.0-nightly.20260509.60",
|
|
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-nightly.
|
|
21
|
+
"version": "0.2.0-nightly.20260509.60",
|
|
22
22
|
"author": "OpenVCS Contributors",
|
|
23
23
|
"description": "Git VCS backend plugin for OpenVCS",
|
|
24
24
|
"default_enabled": true,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"build": "node ./node_modules/@openvcs/sdk/bin/openvcs.js build"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@openvcs/sdk": "edge"
|
|
49
|
+
"@openvcs/sdk": "^0.3.0-edge.20260506.51"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/node": "^25.5.0",
|
package/src/plugin-helpers.ts
CHANGED
|
@@ -111,6 +111,7 @@ export function parseStatusOutput(output: string): StatusParseResult {
|
|
|
111
111
|
const records = output.split('\0').filter(Boolean);
|
|
112
112
|
let ahead = 0;
|
|
113
113
|
let behind = 0;
|
|
114
|
+
let branchOnRemote = false;
|
|
114
115
|
const files: StatusFileEntry[] = [];
|
|
115
116
|
const summary: StatusSummary = {
|
|
116
117
|
untracked: 0,
|
|
@@ -127,6 +128,8 @@ export function parseStatusOutput(output: string): StatusParseResult {
|
|
|
127
128
|
const behindMatch = record.match(/behind\s+(\d+)/);
|
|
128
129
|
ahead = aheadMatch ? Number(aheadMatch[1]) : 0;
|
|
129
130
|
behind = behindMatch ? Number(behindMatch[1]) : 0;
|
|
131
|
+
const trackingMatch = record.match(/^## [^ ]+\.\.\.\S+/);
|
|
132
|
+
branchOnRemote = !!trackingMatch;
|
|
130
133
|
continue;
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -184,6 +187,7 @@ export function parseStatusOutput(output: string): StatusParseResult {
|
|
|
184
187
|
files,
|
|
185
188
|
ahead,
|
|
186
189
|
behind,
|
|
190
|
+
branch_on_remote: branchOnRemote,
|
|
187
191
|
},
|
|
188
192
|
};
|
|
189
193
|
}
|
|
@@ -261,7 +261,15 @@ export class GitVcsDelegates extends VcsDelegateBase<GitRuntimeDependencies> {
|
|
|
261
261
|
_context: PluginRuntimeContext,
|
|
262
262
|
): null {
|
|
263
263
|
const git = this.requireGit(params.session_id);
|
|
264
|
-
|
|
264
|
+
const name = asTrimmedString(params.name);
|
|
265
|
+
const checkout = params.checkout === true;
|
|
266
|
+
|
|
267
|
+
if (checkout) {
|
|
268
|
+
git.createBranch(name);
|
|
269
|
+
git.checkoutBranch(name);
|
|
270
|
+
} else {
|
|
271
|
+
git.createBranch(name);
|
|
272
|
+
}
|
|
265
273
|
return null;
|
|
266
274
|
}
|
|
267
275
|
|