Skip to content

Commit 67d043e

Browse files
committed
Merge pull request #15 from neel1996/gitdiff-issue-fix
1 parent d118a42 commit 67d043e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

git/gitFileDifferenceAPI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function getGitFileDifference(repoId, fileName) {
2525
console.log(err);
2626
});
2727

28-
const diffStat = await execPromisified(`git diff --stat ${fileName}`, {
28+
const diffStat = await execPromisified(`git diff --stat "${fileName}"`, {
2929
cwd: repoPath,
3030
windowsHide: true,
3131
})
@@ -43,7 +43,7 @@ async function getGitFileDifference(repoId, fileName) {
4343
});
4444

4545
const fileDiff = await execPromisified(
46-
`git diff -U${fileContentLength} ${fileName}`,
46+
`git diff -U${fileContentLength} "${fileName}"`,
4747
{
4848
cwd: repoPath,
4949
windowsHide: true,

git/gitRemoveStagedItems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const execPromisified = util.promisify(exec);
66
const fetchRepopath = require("../global/fetchGitRepoPath");
77

88
const gitRemoveStagedItemApi = async (repoId, item) => {
9-
return await execPromisified(`git reset ${item}`, {
9+
return await execPromisified(`git reset "${item}"`, {
1010
cwd: fetchRepopath.getRepoPath(repoId),
1111
windowsHide: true,
1212
})

git/gitRepoStatus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const getGitStatus = async (repoPath) => {
224224
isGitLogAvailable &&
225225
(await Promise.all(
226226
gitTrackedFileDetails.map(async (gitFile) => {
227-
return await execPromised(`git log -1 --oneline ${gitFile}`, {
227+
return await execPromised(`git log -1 --oneline "${gitFile}"`, {
228228
cwd: repoPath,
229229
windowsHide: true,
230230
})

git/gitStageItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const execPromisified = util.promisify(exec);
55
const fetchRepopath = require("../global/fetchGitRepoPath");
66

77
const gitStageItem = async (repoId, item) => {
8-
return await execPromisified(`git add ${item}`, {
8+
return await execPromisified(`git add "${item}"`, {
99
cwd: fetchRepopath.getRepoPath(repoId),
1010
windowsHide: true,
1111
}).then(({ stdout, stderr }) => {

0 commit comments

Comments
 (0)