addyosmani / addyosmani/git2txt

Bug: Output filename incorrectly generated for certain GitHub URL formats

未关闭
#13 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
564
派生
58
PR 合并指标
30 天内没有已合并 PR

描述

## 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
1. Run the tool with a GitHub URL ending in a slash:
```bash
git2txt https://github.com/username/repository/
```
Expected: Output file named `repository.txt`
Actual: Output file named `.txt`

2. Run the tool with a short format URL:
```bash
git2txt username/repository
```
Expected: Output file named `repository.txt`
Actual: Output file named `repository.txt` (works correctly)

3. Run the tool with an SSH URL:
```bash
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`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。