File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,9 @@ def fetch_contents(path):
173173 if not token :
174174 print (f"Error 404: Repository not found or is private.\n "
175175 f"If this is a private repository, please provide a valid GitHub token via the 'token' argument or set the GITHUB_TOKEN environment variable." )
176+ elif not path and ref == 'main' :
177+ print (f"Error 404: Repository not found. Check if the default branch is not 'main'\n "
178+ f"Try adding branch name to the request i.e. python main.py --repo https://github.com/username/repo/tree/master" )
176179 else :
177180 print (f"Error 404: Path '{ path } ' not found in repository or insufficient permissions with the provided token.\n "
178181 f"Please verify the token has access to this repository and the path exists." )
@@ -309,4 +312,4 @@ def fetch_contents(path):
309312 if files :
310313 sample_file = next (iter (files ))
311314 print (f"\n Sample file: { sample_file } " )
312- print (f"Content preview: { files [sample_file ][:200 ]} ..." )
315+ print (f"Content preview: { files [sample_file ][:200 ]} ..." )
You can’t perform that action at this time.
0 commit comments