Skip to content

Commit 613e9c9

Browse files
runningcodeclaude
andcommitted
feat(vcs): Prefer upstream remote over origin for base repo name
When determining the base repository name, now prioritizes: 1. upstream (if exists) 2. origin (if exists) 3. first available remote This follows Git conventions where upstream typically refers to the original repository when working with forks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3c48dab commit 613e9c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/vcs.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,10 @@ pub fn git_repo_base_repo_name(repo: &git2::Repository) -> Result<Option<String>
295295
return Ok(None);
296296
}
297297

298-
// Prefer "origin" remote if it exists, otherwise use the first one
299-
let chosen_remote = if remote_names.contains(&"origin") {
298+
// Prefer "upstream" if it exists, then "origin", otherwise use the first one
299+
let chosen_remote = if remote_names.contains(&"upstream") {
300+
"upstream"
301+
} else if remote_names.contains(&"origin") {
300302
"origin"
301303
} else {
302304
remote_names[0]

0 commit comments

Comments
 (0)