Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support updating submodules to main branch #497

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions TarSCM/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ def parse_args(self, options):
parser.add_argument('--subdir', default='',
help='Package just a subdirectory of the sources')
parser.add_argument('--submodules',
choices=['enable', 'master', 'disable'],
choices=['enable', 'master', 'main', 'disable'],
default='enable',
help='Whether or not to include git submodules '
'from SCM commit log since a given parent '
'revision (see changesrevision). Use '
'\'master\' to fetch the latest master.')
'\'master\' or \'main\' to fetch the latest'
'development revision.')
parser.add_argument('--lfs',
choices=['enable', 'disable'],
default='disable',
Expand Down
3 changes: 2 additions & 1 deletion TarSCM/scm/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def fetch_submodules(self):
'--recursive'],
cwd=self.clone_dir
)
elif 'submodules' in argsd and argsd['submodules'] == 'master':
elif 'submodules' in argsd and \
argsd['submodules'] in ['main', 'master']:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is not a multiple of four
unexpected indentation

self.helpers.safe_run(
self._get_scm_cmd() + ['submodule', 'update', '--init',
'--recursive', '--remote'],
Expand Down
3 changes: 2 additions & 1 deletion appimage.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<summary>handle sources specified in appimage.yml</summary>
<description>This service needs to be executed to download sources according to appimage.yml file</description>
<parameter name="submodules">
<description>Specify whether to include git submodules. Default is 'enable'.</description>
<description>Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch.</description>
<allowedvalue>enable</allowedvalue>
<allowedvalue>master</allowedvalue>
<allowedvalue>main</allowedvalue>
<allowedvalue>disable</allowedvalue>
</parameter>
<parameter name="lfs">
Expand Down
3 changes: 2 additions & 1 deletion snapcraft.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<summary>handle sources specified in snapcraft.yaml</summary>
<description>This service needs to be executed to download sources according to snapcraft.yaml file. It also patches the snapcraft tile to use local sources during build.</description>
<parameter name="submodules">
<description>Specify whether to include git submodules. Default is 'enable'.</description>
<description>Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch.</description>
<allowedvalue>enable</allowedvalue>
<allowedvalue>master</allowedvalue>
<allowedvalue>main</allowedvalue>
<allowedvalue>disable</allowedvalue>
</parameter>
<parameter name="lfs">
Expand Down
3 changes: 2 additions & 1 deletion tar_scm.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ which get maintained in the SCM. Can be used multiple times.</description>
<description>Obsolete parameter which will be ignored.</description>
</parameter>
<parameter name="submodules">
<description>Specify whether to include git submodules. Default is 'enable'.</description>
<description>Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch.</description>
<allowedvalue>enable</allowedvalue>
<allowedvalue>master</allowedvalue>
<allowedvalue>main</allowedvalue>
<allowedvalue>disable</allowedvalue>
</parameter>
===OBS_ONLY
Expand Down
Loading