File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ def project_root_from_module_root(module_root: Path, pyproject_file_path: Path)
249249
250250
251251def handle_optimize_all_arg_parsing (args : Namespace ) -> Namespace :
252- if hasattr (args , "all" ):
252+ if hasattr (args , "all" ) or args . file :
253253 import git
254254
255255 from codeflash .code_utils .git_utils import check_and_push_branch , get_repo_owner_and_name
@@ -259,9 +259,10 @@ def handle_optimize_all_arg_parsing(args: Namespace) -> Namespace:
259259 try :
260260 git_repo = git .Repo (search_parent_directories = True )
261261 except git .exc .InvalidGitRepositoryError :
262+ mode = "--all" if hasattr (args , "all" ) else "--file"
262263 logger .exception (
263- "I couldn't find a git repository in the current directory. "
264- "I need a git repository to run --all and open PRs for optimizations. Exiting..."
264+ f "I couldn't find a git repository in the current directory. "
265+ f "I need a git repository to run { mode } and open PRs for optimizations. Exiting..."
265266 )
266267 apologize_and_exit ()
267268 if not args .no_pr and not check_and_push_branch (git_repo , git_remote = args .git_remote ):
You can’t perform that action at this time.
0 commit comments