Description
The git2txt tool sometimes generates incorrect output filenames when processing certain GitHub repository URL formats. This happens because the repository name extraction logic doesn't handle all URL formats consistently.
Steps to Reproduce
-
Run the tool with a GitHub URL ending in a slash:
git2txt https://github.com/username/repository/
Expected: Output file named repository.txt
Actual: Output file named .txt
-
Run the tool with a short format URL:
git2txt username/repository
Expected: Output file named repository.txt
Actual: Output file named repository.txt (works correctly)
-
Run the tool with an SSH URL:
git2txt git@github.com:username/repository
Expected: Output file named repository.txt
Actual: Output file named repository (missing .txt extension)
Impact
- Users get unexpected output filenames
- Some formats result in files without the .txt extension
- URLs with trailing slashes create files named just
.txt
Description
The
git2txttool sometimes generates incorrect output filenames when processing certain GitHub repository URL formats. This happens because the repository name extraction logic doesn't handle all URL formats consistently.Steps to Reproduce
Run the tool with a GitHub URL ending in a slash:
Expected: Output file named
repository.txtActual: Output file named
.txtRun the tool with a short format URL:
Expected: Output file named
repository.txtActual: Output file named
repository.txt(works correctly)Run the tool with an SSH URL:
Expected: Output file named
repository.txtActual: Output file named
repository(missing .txt extension)Impact
.txt