mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
aider: Fixed indentation for get_git_root()
function and following lines.
# Context: USER: fix the indentation! ASSISTANT: I apologize for the indentation issue. Here's the corrected version of the `aider/main.py` file: ```python aider/main.py <<<<<<< ORIGINAL def main(args=None, input=None, output=None): if args is None: args = sys.argv[1:] load_dotenv() env_prefix = "AIDER_" def get_git_root(): try: repo = git.Repo(search_parent_directories=True) return repo.working_tree_dir except git.InvalidGitRepositoryError: return None default_config_files = [ os.path.expanduser("~/.aider.conf.yml"), ] git_root = get_git_root() if git_root: default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml")) ======= def main(args=None, input=None, output=None): if args is None: args = sys.argv[1:] load_dotenv() env_prefix = "AIDER_" def get_git_root(): try: repo = git.Repo(search_parent_directories=True) return repo.working_tree_dir except git.InvalidGitRepositoryError: return None default_config_files = [ os.path.expanduser("~/.aider.conf.yml"), ] git_root = get_git_root() if git_root: default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml")) >>>>>>> UPDATED ``` This update fixes the indentation for the `get_git_root()` function and the following lines.
This commit is contained in:
parent
05e976a2b6
commit
a7aa95b18c
1 changed files with 12 additions and 11 deletions
|
@ -13,20 +13,21 @@ def main(args=None, input=None, output=None):
|
|||
|
||||
load_dotenv()
|
||||
env_prefix = "AIDER_"
|
||||
|
||||
def get_git_root():
|
||||
try:
|
||||
repo = git.Repo(search_parent_directories=True)
|
||||
return repo.working_tree_dir
|
||||
except git.InvalidGitRepositoryError:
|
||||
return None
|
||||
try:
|
||||
repo = git.Repo(search_parent_directories=True)
|
||||
return repo.working_tree_dir
|
||||
except git.InvalidGitRepositoryError:
|
||||
return None
|
||||
|
||||
default_config_files = [
|
||||
os.path.expanduser("~/.aider.conf.yml"),
|
||||
]
|
||||
default_config_files = [
|
||||
os.path.expanduser("~/.aider.conf.yml"),
|
||||
]
|
||||
|
||||
git_root = get_git_root()
|
||||
if git_root:
|
||||
default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml"))
|
||||
git_root = get_git_root()
|
||||
if git_root:
|
||||
default_config_files.insert(0, os.path.join(git_root, ".aider.conf.yml"))
|
||||
|
||||
parser = configargparse.ArgumentParser(
|
||||
description="aider - chat with GPT about your code",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue