summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Retailleau <jeremy.retailleau@gmail.com>2020-09-03 11:11:34 -0700
committerJeremy Retailleau <jeremy.retailleau@gmail.com>2020-09-03 11:11:34 -0700
commit3787f622e59c2fecfa47efc114c409f51a27bbe7 (patch)
treed0220b06beb542e18ffb62161720af801a1e43ba
parent2c4dec45d387ccebfe9bd423bc8e633210d3cdbd (diff)
downloadgitpython-3787f622e59c2fecfa47efc114c409f51a27bbe7.tar.gz
Reformat code to remove unnecessary indentation
-rw-r--r--git/config.py60
1 files changed, 31 insertions, 29 deletions
diff --git a/git/config.py b/git/config.py
index f9a5a46b..b49f0790 100644
--- a/git/config.py
+++ b/git/config.py
@@ -464,35 +464,37 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje
paths += self.items(section)
match = CONDITIONAL_INCLUDE_REGEXP.search(section)
- if match is not None and self._repo is not None:
- keyword = match.group(1)
- value = match.group(2).strip()
-
- if keyword in ["gitdir", "gitdir/i"]:
- value = osp.expanduser(value)
-
- if not any(value.startswith(s) for s in ["./", "/"]):
- value = "**/" + value
- if value.endswith("/"):
- value += "**"
-
- # Ensure that glob is always case insensitive if required.
- if keyword.endswith("/i"):
- value = re.sub(
- r"[a-zA-Z]",
- lambda m: "[{}{}]".format(
- m.group().lower(),
- m.group().upper()
- ),
- value
- )
-
- if fnmatch.fnmatchcase(self._repo.git_dir, value):
- paths += self.items(section)
-
- elif keyword == "onbranch":
- if fnmatch.fnmatchcase(self._repo.active_branch.name, value):
- paths += self.items(section)
+ if match is None or self._repo is None:
+ continue
+
+ keyword = match.group(1)
+ value = match.group(2).strip()
+
+ if keyword in ["gitdir", "gitdir/i"]:
+ value = osp.expanduser(value)
+
+ if not any(value.startswith(s) for s in ["./", "/"]):
+ value = "**/" + value
+ if value.endswith("/"):
+ value += "**"
+
+ # Ensure that glob is always case insensitive if required.
+ if keyword.endswith("/i"):
+ value = re.sub(
+ r"[a-zA-Z]",
+ lambda m: "[{}{}]".format(
+ m.group().lower(),
+ m.group().upper()
+ ),
+ value
+ )
+
+ if fnmatch.fnmatchcase(self._repo.git_dir, value):
+ paths += self.items(section)
+
+ elif keyword == "onbranch":
+ if fnmatch.fnmatchcase(self._repo.active_branch.name, value):
+ paths += self.items(section)
return paths