From 7fec6f03c8f6cb108f9222716d440b0cbf45aa0d Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 16 Oct 2018 05:49:56 +0200 Subject: [PATCH] commands: project: Use remote name from manifest instead of 'origin' To be consistent with repo (though I haven't actually checked the behavior myself). Fixes: #73 Signed-off-by: Ulf Magnusson --- src/west/commands/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/west/commands/project.py b/src/west/commands/project.py index 5d47c2c..3f60049 100644 --- a/src/west/commands/project.py +++ b/src/west/commands/project.py @@ -479,7 +479,7 @@ def _fetch(project): if not exists: _inf(project, 'Creating repository for (name-and-path)') _git_base(project, 'init (abspath)') - _git(project, 'remote add origin -- (url)') + _git(project, 'remote add -- (remote-name) (url)') # Fetch the revision specified in the manifest into the manifest-rev branch @@ -495,7 +495,7 @@ def _fetch(project): # when the revision is an annotated tag. ^{commit} type peeling isn't # supported for the in a : refspec, so we have to do it # separately. - _git(project, fetch_cmd + ' origin -- (revision)') + _git(project, fetch_cmd + ' -- (remote-name) (revision)') _git(project, 'update-ref (qual-manifest-rev-branch) FETCH_HEAD^{commit}') if not _ref_ok(project, 'HEAD'): @@ -753,6 +753,7 @@ def _expand_shorthands(project, s): .replace('(name-and-path)', '{} ({})'.format( project.name, os.path.join(project.path, ""))) \ + .replace('(remote-name)', project.remote.name) \ .replace('(url)', project.url) \ .replace('(path)', project.path) \ .replace('(abspath)', project.abspath) \