Skip to content

Commit 3787f62

Browse files
committed
Reformat code to remove unnecessary indentation
1 parent 2c4dec4 commit 3787f62

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

git/config.py

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -464,35 +464,37 @@ def _included_paths(self):
464464
paths += self.items(section)
465465

466466
match = CONDITIONAL_INCLUDE_REGEXP.search(section)
467-
if match is not None and self._repo is not None:
468-
keyword = match.group(1)
469-
value = match.group(2).strip()
470-
471-
if keyword in ["gitdir", "gitdir/i"]:
472-
value = osp.expanduser(value)
473-
474-
if not any(value.startswith(s) for s in ["./", "/"]):
475-
value = "**/" + value
476-
if value.endswith("/"):
477-
value += "**"
478-
479-
# Ensure that glob is always case insensitive if required.
480-
if keyword.endswith("/i"):
481-
value = re.sub(
482-
r"[a-zA-Z]",
483-
lambda m: "[{}{}]".format(
484-
m.group().lower(),
485-
m.group().upper()
486-
),
487-
value
488-
)
489-
490-
if fnmatch.fnmatchcase(self._repo.git_dir, value):
491-
paths += self.items(section)
492-
493-
elif keyword == "onbranch":
494-
if fnmatch.fnmatchcase(self._repo.active_branch.name, value):
495-
paths += self.items(section)
467+
if match is None or self._repo is None:
468+
continue
469+
470+
keyword = match.group(1)
471+
value = match.group(2).strip()
472+
473+
if keyword in ["gitdir", "gitdir/i"]:
474+
value = osp.expanduser(value)
475+
476+
if not any(value.startswith(s) for s in ["./", "/"]):
477+
value = "**/" + value
478+
if value.endswith("/"):
479+
value += "**"
480+
481+
# Ensure that glob is always case insensitive if required.
482+
if keyword.endswith("/i"):
483+
value = re.sub(
484+
r"[a-zA-Z]",
485+
lambda m: "[{}{}]".format(
486+
m.group().lower(),
487+
m.group().upper()
488+
),
489+
value
490+
)
491+
492+
if fnmatch.fnmatchcase(self._repo.git_dir, value):
493+
paths += self.items(section)
494+
495+
elif keyword == "onbranch":
496+
if fnmatch.fnmatchcase(self._repo.active_branch.name, value):
497+
paths += self.items(section)
496498

497499
return paths
498500

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy