@openvcs/git-plugin 0.2.0-nightly.20260509.60 → 0.3.0-beta.74

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/git.js CHANGED
@@ -4,7 +4,7 @@ import { spawnSync } from 'node:child_process';
4
4
  import { rmSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
6
  import { pluginError } from '@openvcs/sdk/runtime';
7
- import { applySubmoduleStatusHints, asString, buildFetchArgs, buildPullFfOnlyArgs, buildPushArgs, buildSubmoduleUpdateArgs, parseCommits, parseStatusOutput, } from './plugin-helpers.js';
7
+ import { applySubmoduleStatusHints, asString, buildFetchArgs, buildPullArgs, buildPushArgs, buildSubmoduleUpdateArgs, parseCommits, parseStatusOutput, } from './plugin-helpers.js';
8
8
  export class GitCommand {
9
9
  cwd;
10
10
  constructor(cwd) {
@@ -160,7 +160,7 @@ export class GitCommand {
160
160
  return this.runChecked(args, 'git-push-failed');
161
161
  }
162
162
  pull(options = {}) {
163
- const args = buildPullFfOnlyArgs(options);
163
+ const args = buildPullArgs(options);
164
164
  return this.runChecked(args, 'git-pull-failed');
165
165
  }
166
166
  /** Returns the current HEAD commit id. */
@@ -59,9 +59,9 @@ export function buildCloneArgs(params) {
59
59
  pushOptionalArg(args, params.dest);
60
60
  return args;
61
61
  }
62
- /** Builds `git pull --ff-only` arguments while omitting empty optional values. */
63
- export function buildPullFfOnlyArgs(params) {
64
- const args = ['pull', '--ff-only'];
62
+ /** Builds `git pull --no-rebase --no-edit` arguments while omitting empty optional values. */
63
+ export function buildPullArgs(params) {
64
+ const args = ['pull', '--no-rebase', '--no-edit'];
65
65
  pushOptionalArg(args, params.remote);
66
66
  pushOptionalArg(args, params.branch);
67
67
  return args;
@@ -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)).split('\n');
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)).split('\n');
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-nightly.20260509.60",
3
+ "version": "0.3.0-beta.74",
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.20260509.60",
21
+ "version": "0.3.0-beta.74",
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": "^0.3.0-edge.20260506.51"
49
+ "@openvcs/sdk": "edge"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^25.5.0",
package/src/git.ts CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  applySubmoduleStatusHints,
18
18
  asString,
19
19
  buildFetchArgs,
20
- buildPullFfOnlyArgs,
20
+ buildPullArgs,
21
21
  buildPushArgs,
22
22
  buildSubmoduleUpdateArgs,
23
23
  parseCommits,
@@ -270,7 +270,7 @@ export class GitCommand {
270
270
  }
271
271
 
272
272
  pull(options: PullOptions = {}): GitCommandResult {
273
- const args = buildPullFfOnlyArgs(options as unknown as Record<string, unknown>);
273
+ const args = buildPullArgs(options as unknown as Record<string, unknown>);
274
274
  return this.runChecked(args, 'git-pull-failed');
275
275
  }
276
276
 
@@ -82,9 +82,9 @@ export function buildCloneArgs(params: RequestParams): string[] {
82
82
  return args;
83
83
  }
84
84
 
85
- /** Builds `git pull --ff-only` arguments while omitting empty optional values. */
86
- export function buildPullFfOnlyArgs(params: RequestParams): string[] {
87
- const args = ['pull', '--ff-only'];
85
+ /** Builds `git pull --no-rebase --no-edit` arguments while omitting empty optional values. */
86
+ export function buildPullArgs(params: RequestParams): string[] {
87
+ const args = ['pull', '--no-rebase', '--no-edit'];
88
88
  pushOptionalArg(args, params.remote);
89
89
  pushOptionalArg(args, params.branch);
90
90
  return args;
@@ -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)).split('\n');
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)).split('\n');
441
+ return splitDiffLines(git.diffCommit(asTrimmedString(params.rev)));
436
442
  }
437
443
 
438
444
  override getConflictDetails(