Fix trying to check for updates if origin doesn't have same branch

main
Nuckyz 8 months ago
parent f70114238c
commit 19799767ad
No known key found for this signature in database
GPG Key ID: 440BF8296E1C4AD9

@ -49,9 +49,12 @@ async function getRepo() {
async function calculateGitChanges() {
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();
return commits ? commits.split("\n").map(line => {

Loading…
Cancel
Save