Skip to content

Commit 3be163e

Browse files
runningcodeclaude
andcommitted
fix(build): Remove remote.connect fallback to avoid SSL/TLS issues
Remove the network fallback that queries remote default branch when origin/HEAD is not set locally. This eliminates SSL/TLS errors that occur when libgit2 lacks proper SSL support. Users without origin/HEAD set up will get a clear error message and can fix it with: git remote set-head origin --auto 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9929139 commit 3be163e

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

src/utils/vcs.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -257,23 +257,7 @@ pub fn git_repo_base_ref(repo: &git2::Repository, remote_name: &str) -> Result<O
257257
let remote_branch_name = format!("refs/remotes/{remote_name}/HEAD");
258258
let remote_ref = repo
259259
.find_reference(&remote_branch_name)
260-
.or_else(|_| -> Result<git2::Reference, anyhow::Error> {
261-
// If remote/HEAD doesn't exist, try to query the remote for its actual default branch
262-
let mut remote = repo.find_remote(remote_name)?;
263-
remote.connect(git2::Direction::Fetch)?;
264-
let default_branch_buf = remote.default_branch()?;
265-
let default_branch = default_branch_buf
266-
.as_str()
267-
.ok_or_else(|| anyhow::anyhow!("Default branch contains invalid UTF-8"))?;
268-
269-
// Convert "refs/heads/main" to "refs/remotes/origin/main"
270-
let branch_name = default_branch
271-
.strip_prefix("refs/heads/")
272-
.unwrap_or(default_branch);
273-
let remote_branch = format!("refs/remotes/{remote_name}/{branch_name}");
274-
Ok(repo.find_reference(&remote_branch)?)
275-
})
276-
.map_err(|e: anyhow::Error| {
260+
.map_err(|e| {
277261
anyhow::anyhow!(
278262
"Could not find remote tracking branch for {}: {}",
279263
remote_name,

0 commit comments

Comments
 (0)