10
310
Fork
You've already forked codeberg-cli
33

fix: repo info now accepts OWNER/REPO without git repository #245

Merged
Aviac merged 1 commit from timstoop/codeberg-cli:fix-repo-info-without-git-repo-v2 into main 2025年10月07日 08:46:37 +02:00
Contributor
Copy link

The command 'berg repo info OWNER/REPO' was failing with "No repository
found in the current path" even when OWNER/REPO was provided as argument.

Root cause: Using .unwrap_or() with a fallback containing a ? operator
caused the git repo check to execute and propagate errors even when the
argument was successfully provided.

Solution: Replace with if-let pattern for lazy evaluation, matching the
working implementation in the issue list command. Now ctx.owner_repo()
only executes when OWNER/REPO is not provided.

Added regression test repoInfoWithoutGitRepo that verifies the command
works from outside a git repository when OWNER/REPO argument is provided.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

The command 'berg repo info OWNER/REPO' was failing with "No repository found in the current path" even when OWNER/REPO was provided as argument. Root cause: Using .unwrap_or() with a fallback containing a ? operator caused the git repo check to execute and propagate errors even when the argument was successfully provided. Solution: Replace with if-let pattern for lazy evaluation, matching the working implementation in the issue list command. Now ctx.owner_repo() only executes when OWNER/REPO is not provided. Added regression test repoInfoWithoutGitRepo that verifies the command works from outside a git repository when OWNER/REPO argument is provided. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The command 'berg repo info OWNER/REPO' was failing with "No repository
found in the current path" even when OWNER/REPO was provided as argument.
Root cause: Using .unwrap_or() with a fallback containing a ? operator
caused the git repo check to execute and propagate errors even when the
argument was successfully provided.
Solution: Replace with if-let pattern for lazy evaluation, matching the
working implementation in the issue list command. Now ctx.owner_repo()
only executes when OWNER/REPO is not provided.
Added regression test repoInfoWithoutGitRepo that verifies the command
works from outside a git repository when OWNER/REPO argument is provided.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Aviac left a comment
Owner
Copy link

Ahh dang, that slipped through. Thanks for adding the integration test 👍

Ahh dang, that slipped through. Thanks for adding the integration test :+1:
Owner
Copy link

Just ran the test, LGTM

Just ran the test, LGTM
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Aviac/codeberg-cli!245
Reference in a new issue
Aviac/codeberg-cli
No description provided.
Delete branch "timstoop/codeberg-cli:fix-repo-info-without-git-repo-v2"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?