summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Lucarella <leandro.lucarella@sociomantic.com>2015-05-13 20:28:04 +0200
committerMihails Strasuns <mihails.strasuns.contractor@sociomantic.com>2015-05-16 16:30:13 +0300
commit6be31ddf792fe6861b41cd594a7bcc4049991d50 (patch)
tree0c9f57712e3c12dcd5c23d36d55b50a6318f2480
parent858060222c4158526aeb5c6791bcd5757ba66849 (diff)
setup: Use plain `git-hub` note for global setup
When using `--global` or `--system` we don't want to use the project name as part of the OAuth token note, even if we are inside a GitHub project.
-rwxr-xr-xgit-hub7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-hub b/git-hub
index a73a85c..5fd0f14 100755
--- a/git-hub
+++ b/git-hub
@@ -649,9 +649,10 @@ class SetupCmd (object):
@classmethod
def run(cls, parser, args):
+ is_global = ('--system' in args.opts or
+ '--global' in args.opts)
try:
- if '--system' not in args.opts and \
- '--global' not in args.opts:
+ if not is_global:
git('rev-parse --git-dir')
except GitError as error:
errf(error.output)
@@ -679,7 +680,7 @@ class SetupCmd (object):
req.set_basic_auth(username, password)
note = 'git-hub'
- if config.forkrepo:
+ if not is_global and config.forkrepo:
proj = config.forkrepo.split('/', 1)[1]
note += ' (%s)' % proj