vg-coder-cli 2.0.17 → 2.0.19
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/change.sh +0 -0
- package/package.json +1 -1
- package/src/server/api-server.js +16 -1
- package/vg-coder-cli-2.0.19.tgz +0 -0
package/change.sh
ADDED
|
File without changes
|
package/package.json
CHANGED
package/src/server/api-server.js
CHANGED
|
@@ -99,7 +99,8 @@ class ApiServer {
|
|
|
99
99
|
// Get Git Status
|
|
100
100
|
this.app.get('/api/git/status', async (req, res) => {
|
|
101
101
|
try {
|
|
102
|
-
|
|
102
|
+
// FIX: Added -u flag to show individual files in untracked directories
|
|
103
|
+
const { stdout } = await execAsync('git status --porcelain -u', { cwd: this.workingDir });
|
|
103
104
|
|
|
104
105
|
const staged = [];
|
|
105
106
|
const unstaged = [];
|
|
@@ -209,6 +210,20 @@ class ApiServer {
|
|
|
209
210
|
cmd = file ? `git diff --cached -- "${file}"` : `git diff --cached`;
|
|
210
211
|
} else {
|
|
211
212
|
if (file) {
|
|
213
|
+
// Check if directory to avoid EISDIR (Safety Check)
|
|
214
|
+
try {
|
|
215
|
+
const filePath = path.join(this.workingDir, file);
|
|
216
|
+
if (await fs.pathExists(filePath)) {
|
|
217
|
+
const stat = await fs.stat(filePath);
|
|
218
|
+
if (stat.isDirectory()) {
|
|
219
|
+
return res.json({ diff: '' });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
} catch (e) {
|
|
223
|
+
// Ignore stat errors
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Check untracked
|
|
212
227
|
const { stdout: isUntracked } = await execAsync(`git ls-files --others --exclude-standard "${file}"`, { cwd: this.workingDir });
|
|
213
228
|
if (isUntracked.trim()) {
|
|
214
229
|
const content = await fs.readFile(path.join(this.workingDir, file), 'utf8');
|
|
Binary file
|