Skip to content

fix: report a missing repository path instead of a traceback - #286

Merged
shenxianpeng merged 1 commit into
shenxianpeng:mainfrom
itzzdev09:missing-repo-path
Sep 22, 2026
Merged

shenxianpeng merged 1 commit into
shenxianpeng:mainfrom
itzzdev09:missing-repo-path

Conversation

@itzzdev09

@itzzdev09 itzzdev09 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Running gitstats on a path that does not exist ends in a traceback from os.chdir:

$ gitstats ./typo out
  File ".../gitstats/main.py", in _run_single_repo
    os.chdir(gitpath)
FileNotFoundError: [Errno 2] No such file or directory: './typo'

_run_single_repo already raises RuntimeError for a bad output path, which run() reports as a FATAL message with exit code 1 and the multi-repository mode lists as a failed repository. It now does the same for a git path that is not a directory:

$ gitstats ./typo out
FATAL: Git path is not a directory: ./typo

Added test_run_missing_repository_path, which fails on main. The full suite passes and ruff check is clean.


📚 Documentation preview 📚: https://gitstats--286.org.readthedocs.build/

@netlify

netlify Bot commented Sep 21, 2026

Copy link
Copy Markdown

Deploy Preview for shenxianpeng-gitstats ready!

Name Link
🔨 Latest commit 5569474
🔍 Latest deploy log https://app.netlify.com/projects/shenxianpeng-gitstats/deploys/6ab185c9c491fd000807c547
😎 Deploy Preview https://deploy-preview-286--shenxianpeng-gitstats.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

@shenxianpeng shenxianpeng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. thanks!

@shenxianpeng
shenxianpeng merged commit a84de7d into shenxianpeng:main Sep 22, 2026
30 checks passed
@shenxianpeng shenxianpeng added the bug Something isn't working label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants