Skip to content

Commit 58f962c

Browse files
committed
Fix default settings for submodule update tool
* Update all branches if no specific branches are specified on the command line. * Output informational messages even if `-n` flag isn't specified.
1 parent dee44b0 commit 58f962c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tools/update_submodules.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def msg_debug(message):
3737
print('debug: {}'.format(message))
3838

3939
def msg_normal(message):
40-
if verbosity > 0:
40+
if verbosity >= 0:
4141
print(message)
4242

4343
def git_cmd(path, cmd):
@@ -229,7 +229,7 @@ def process_repository(path, remote, branches=None):
229229
parser.add_argument('remote', help='name of remote repo to update',
230230
metavar='REMOTE', default='origin', nargs='?')
231231
parser.add_argument('branches', help='name of a remote branch to update',
232-
action='append', metavar='BRANCH', nargs='*')
232+
metavar='BRANCH', nargs='*')
233233
parser.add_argument('-n', help='disable pushing changes to remote repo',
234234
action='store_true', dest='dry_run')
235235
parser.add_argument('-C', metavar='PATH', help='run in a different directory',
@@ -243,7 +243,10 @@ def process_repository(path, remote, branches=None):
243243
dry_run = args.dry_run
244244
repo_path = args.repo
245245
remote = args.remote
246-
branches = args.branches
246+
if len(args.branches) > 0:
247+
branches = args.branches
248+
else:
249+
branches = None
247250

248251
if not is_repo_clean(repo_path):
249252
print(

0 commit comments

Comments
 (0)