diff --git a/lib/cli.js b/lib/cli.js index e7d4086..87af095 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -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"; diff --git a/lib/gerrit.js b/lib/gerrit.js index 0826923..0587676 100644 --- a/lib/gerrit.js +++ b/lib/gerrit.js @@ -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() {