summaryrefslogtreecommitdiff
path: root/git/repo/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-06-10 14:01:56 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-06-10 14:01:56 +0200
commita771e102ec2238a60277e2dce68283833060fd37 (patch)
tree62cecf34f2c3a2ed36c610412982afd5764c0483 /git/repo/base.py
parentb8e700e952d135c6903b97f022211809338232e5 (diff)
downloadgitpython-a771e102ec2238a60277e2dce68283833060fd37.tar.gz
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 to #294
Diffstat (limited to 'git/repo/base.py')
-rw-r--r--git/repo/base.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index bb9fb72c..f9d4ad6d 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -564,7 +564,7 @@ class Repo(object):
doc="Retrieve a list of alternates paths or set a list paths to be used as alternates")
def is_dirty(self, index=True, working_tree=True, untracked_files=False,
- consider_submodules=True):
+ submodules=True):
"""
:return:
``True``, the repository is considered dirty. By default it will react
@@ -577,7 +577,7 @@ class Repo(object):
# start from the one which is fastest to evaluate
default_args = ['--abbrev=40', '--full-index', '--raw']
- if not consider_submodules:
+ if not submodules:
default_args.append('--ignore-submodules')
if index:
# diff index against HEAD
@@ -591,10 +591,7 @@ class Repo(object):
return True
# END working tree handling
if untracked_files:
- kwargs = {}
- if not consider_submodules:
- kwargs['ignore_submodules'] = True
- if len(self._get_untracked_files(**kwargs)):
+ if len(self._get_untracked_files(ignore_submodules=not submodules)):
return True
# END untracked files
return False