gitnexus 1.6.4-rc.66 → 1.6.4-rc.67

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.
@@ -13,7 +13,17 @@ export const isGitRepo = (repoPath) => {
13
13
  };
14
14
  export const getCurrentCommit = (repoPath) => {
15
15
  try {
16
- return execSync('git rev-parse HEAD', { cwd: repoPath }).toString().trim();
16
+ return execSync('git rev-parse HEAD', {
17
+ cwd: repoPath,
18
+ // Suppress stderr -- without an explicit stdio option, Node's execSync
19
+ // forwards the child's stderr to the parent process (documented behaviour).
20
+ // When repoPath is not inside a git worktree, git prints
21
+ // "fatal: not a git repository" to stderr, which leaks to the user's
22
+ // terminal even though the error is caught here (#1172).
23
+ stdio: ['ignore', 'pipe', 'ignore'],
24
+ })
25
+ .toString()
26
+ .trim();
17
27
  }
18
28
  catch {
19
29
  return '';
@@ -83,7 +93,13 @@ export const getRemoteUrl = (repoPath) => {
83
93
  */
84
94
  export const getGitRoot = (fromPath) => {
85
95
  try {
86
- const raw = execSync('git rev-parse --show-toplevel', { cwd: fromPath }).toString().trim();
96
+ const raw = execSync('git rev-parse --show-toplevel', {
97
+ cwd: fromPath,
98
+ // Suppress stderr -- see getCurrentCommit comment and #1172.
99
+ stdio: ['ignore', 'pipe', 'ignore'],
100
+ })
101
+ .toString()
102
+ .trim();
87
103
  // On Windows, git returns /d/Projects/Foo — path.resolve normalizes to D:\Projects\Foo
88
104
  return path.resolve(raw);
89
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.4-rc.66",
3
+ "version": "1.6.4-rc.67",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",