Skip to content

Commit

Permalink
Update git command
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed May 9, 2024
1 parent 9782a3c commit 60f47ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ function main() {
let d = os.exec("git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'");
if (d.error) {
// Try fallback method
console.warn(`Could not determine default remote repository, trying fallback method ${d.stdout}`);
d = os.exec("basename $(git symbolic-ref --short refs/remotes/origin/HEAD)");
}
if (d.error) {
// It's not nescessary to fail here, just warn the user
// Git *CAN* handle pushes without specifying the remote repository
console.warn(`Could not determine default remote repository, using 'master' ${d.stdout}`);
console.warn(`Could not determine default remote repository, using 'master'.\nFallback Output: ${d.stdout}`);
} else {
pushStr += ` -u origin ${d.stdout.trim()}`;
}
Expand Down

0 comments on commit 60f47ff

Please sign in to comment.