Fix trying to check for updates if origin doesn't have same branch
This commit is contained in:
parent
f70114238c
commit
19799767ad
|
@ -49,9 +49,12 @@ async function getRepo() {
|
||||||
async function calculateGitChanges() {
|
async function calculateGitChanges() {
|
||||||
await git("fetch");
|
await git("fetch");
|
||||||
|
|
||||||
const branch = await git("branch", "--show-current");
|
const branch = (await git("branch", "--show-current")).stdout.trim();
|
||||||
|
|
||||||
const res = await git("log", `HEAD...origin/${branch.stdout.trim()}`, "--pretty=format:%an/%h/%s");
|
const existsOnOrigin = (await git("ls-remote", "origin", branch)).stdout.length > 0;
|
||||||
|
if (!existsOnOrigin) return [];
|
||||||
|
|
||||||
|
const res = await git("log", `HEAD...origin/${branch}`, "--pretty=format:%an/%h/%s");
|
||||||
|
|
||||||
const commits = res.stdout.trim();
|
const commits = res.stdout.trim();
|
||||||
return commits ? commits.split("\n").map(line => {
|
return commits ? commits.split("\n").map(line => {
|
||||||
|
|
Loading…
Reference in a new issue