Skip to content

Commit

Permalink
specify local scope for gerrit-default-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccandless committed Oct 13, 2017
1 parent c562bb4 commit 0c1ea54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cli.config = function(name, options) {
else {

if (!git.config("gerrit.default-remote")) {
git.config("gerrit.default-remote", "origin");
git.config("gerrit.default-remote", "origin", {local: true});
}

name = name || "default";
Expand Down
7 changes: 6 additions & 1 deletion lib/gerrit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ gerrit.GerritError = GerritError;

gerrit.parseRemote = function(remote) {

remote = remote || git.config("gerrit.default-remote") || "origin";
var defaultRemote = git.config("gerrit.default-remote", {local: true});
if (!defaultRemote) {
var defaultRemote = "origin";
git.config("gerrit.default-remote", defaultRemote, {local: true});
}
remote = remote || defaultRemote || "origin";

return requireInRepo()
.then(function() {
Expand Down

0 comments on commit 0c1ea54

Please sign in to comment.