Skip to content

Commit

Permalink
Revert "feedstock_io: Always search parent directories"
Browse files Browse the repository at this point in the history
This reverts commit a21d135.
  • Loading branch information
mgorny committed Nov 11, 2024
1 parent a6eb2e2 commit 6b820d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions conda_smithy/feedstock_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
from contextlib import contextmanager


def get_repo(path):
def get_repo(path, search_parent_directories=True):
repo = None
try:
import pygit2

repo = pygit2.Repository(path)
if search_parent_directories:
path = pygit2.discover_repository(path)
if path is not None:
repo = pygit2.Repository(
path, pygit2.enums.RepositoryOpenFlag.NO_SEARCH
)
except ImportError:
pass
except pygit2.GitError:
Expand Down

0 comments on commit 6b820d7

Please sign in to comment.