Skip to content

Commit 1e0a8ad

Browse files
committed
Merge pull request #6 from neel1996/fetchapi-patch
1 parent c00d89b commit 1e0a8ad

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

git/gitFetchPullApi.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ const gitFetchApi = async (repoId) => {
99
cwd: fetchRepopath.getRepoPath(repoId),
1010
})
1111
.then(({ stdout, stderr }) => {
12-
if (stdout && !stderr) {
13-
const fetchResponse = stdout.trim().split("\n");
14-
if (fetchResponse && fetchResponse.length > 0) {
12+
if (stdout || stderr) {
13+
// Git fetch alone returns the result in the standard error stream
14+
const fetchResponse = stderr.trim().split("\n");
15+
16+
console.log("Fetch Response :" + fetchResponse);
17+
if (fetchResponse) {
1518
return {
1619
status: "FETCH_PRESENT",
1720
fetchedItems: fetchResponse,
@@ -22,7 +25,6 @@ const gitFetchApi = async (repoId) => {
2225
};
2326
}
2427
} else {
25-
console.log(stderr);
2628
return {
2729
status: "FETCH_ABSENT",
2830
};

0 commit comments

Comments
 (0)