Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita771e10

Browse files
committed
refactor(repo): parameter renaming and cleanup
* renamed `consider_submodules` to `submodules` to be in line with the existing parameters. Nowadays I would prefer the `consider_` prefix, but can't change the existing API and thus stick to the current naming scheme.* reduced amount of code in one portion to make it more maintainable.Related togitpython-developers#294
1 parentb8e700e commita771e10

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎git/repo/base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def _set_alternates(self, alts):
564564
doc="Retrieve a list of alternates paths or set a list paths to be used as alternates")
565565

566566
defis_dirty(self,index=True,working_tree=True,untracked_files=False,
567-
consider_submodules=True):
567+
submodules=True):
568568
"""
569569
:return:
570570
``True``, the repository is considered dirty. By default it will react
@@ -577,7 +577,7 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False,
577577

578578
# start from the one which is fastest to evaluate
579579
default_args= ['--abbrev=40','--full-index','--raw']
580-
ifnotconsider_submodules:
580+
ifnotsubmodules:
581581
default_args.append('--ignore-submodules')
582582
ifindex:
583583
# diff index against HEAD
@@ -591,10 +591,7 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False,
591591
returnTrue
592592
# END working tree handling
593593
ifuntracked_files:
594-
kwargs= {}
595-
ifnotconsider_submodules:
596-
kwargs['ignore_submodules']=True
597-
iflen(self._get_untracked_files(**kwargs)):
594+
iflen(self._get_untracked_files(ignore_submodules=notsubmodules)):
598595
returnTrue
599596
# END untracked files
600597
returnFalse

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp