Skip to content

Commit

Permalink
Merge pull request #497 from adrianschroeter/main_branch_update
Browse files Browse the repository at this point in the history
Support updating submodules to main branch
  • Loading branch information
adrianschroeter authored Jul 31, 2024
2 parents fda75dc + 1429ea9 commit aa42eca
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
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']:
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

0 comments on commit aa42eca

Please sign in to comment.