Bug
When a git repo has multiple remotes (e.g., origin + upstream) and the current branch does not track a remote branch, fj errors with:
Error: no repo info specified
If you're trying to operate on a repository in the current directory, try adding a remote
referencing the forgejo instance. If you have multiple remotes, try setting one as upstream to the
current branch. You may also specify a host explicitly using the `--host` argument.
Steps to reproduce
git remote add upstream https://codeberg.org/forgejo-contrib/forgejo-cli.git
git checkout -b new-branch # no upstream tracking
fj issue view 1 # Error: no repo info specified
Expected behavior
fj should fall back to the origin remote when:
- Multiple remotes exist
- The current branch doesn't track any remote
- No
--remoteor--hostwas specified
This matches the convention used by git push, gh, and other CLI tools that treat origin as the default remote.
Workaround
Pass --remote origin explicitly:
fj issue view 1 --remote origin
Location
The fallback chain is in src/repo.rs in RepoInfo::get_current(). After checking for a single remote and branch tracking, there is no origin fallback before the error path.
## Bug
When a git repo has multiple remotes (e.g., `origin` + `upstream`) and the current branch does not track a remote branch, `fj` errors with:
```
Error: no repo info specified
If you're trying to operate on a repository in the current directory, try adding a remote
referencing the forgejo instance. If you have multiple remotes, try setting one as upstream to the
current branch. You may also specify a host explicitly using the `--host` argument.
```
### Steps to reproduce
```sh
git remote add upstream https://codeberg.org/forgejo-contrib/forgejo-cli.git
git checkout -b new-branch # no upstream tracking
fj issue view 1 # Error: no repo info specified
```
### Expected behavior
`fj` should fall back to the `origin` remote when:
1. Multiple remotes exist
2. The current branch doesn't track any remote
3. No `--remote` or `--host` was specified
This matches the convention used by `git push`, `gh`, and other CLI tools that treat `origin` as the default remote.
### Workaround
Pass `--remote origin` explicitly:
```sh
fj issue view 1 --remote origin
```
### Location
The fallback chain is in `src/repo.rs` in `RepoInfo::get_current()`. After checking for a single remote and branch tracking, there is no `origin` fallback before the error path.