Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot clone a repo if its origin is not master but main #19464

Closed
2 of 3 tasks
startergo opened this issue Mar 11, 2025 · 1 comment
Closed
2 of 3 tasks

Cannot clone a repo if its origin is not master but main #19464

startergo opened this issue Mar 11, 2025 · 1 comment

Comments

@startergo
Copy link

startergo commented Mar 11, 2025

brew doctor output

brew doctor
Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

brew config
HOMEBREW_VERSION: 4.4.24
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2f6db3757e6c8533750264c0d397c3671665e2f4
Last commit: 27 hours ago
Branch: stable
Core tap JSON: 11 Mar 11:49 UTC
Core cask tap JSON: 11 Mar 11:49 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.deyzcifiHr/org.xquartz:0
HOMEBREW_MAKE_JOBS: 14
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: 14-core 64-bit arm_brava
Clang: 17.0.0 build 1700
Git: 2.39.5 => /Applications/Xcode-beta.app/Contents/Developer/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3.1-arm64
CLT: 16.3.0.0.1.1739832865
Xcode: 16.3 => /Applications/Xcode-beta.app/Contents/Developer
Rosetta 2: false

What were you trying to do (and why)?

trying to clone a repo with refs/heads/main instead of refs/heads/master

What happened (include all command output)?

==> Cloning https://chromium.googlesource.com/angle/angle
/usr/bin/env git --git-dir /Users/macbookpro/Library/Caches/Homebrew/libangle--git/.git status -s
Updating /Users/macbookpro/Library/Caches/Homebrew/libangle--git
/usr/bin/env git config remote.origin.url https://chromium.googlesource.com/angle/angle
/usr/bin/env git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
/usr/bin/env git config remote.origin.tagOpt --no-tags
/usr/bin/env git config advice.detachedHead false
/usr/bin/env git config core.fsmonitor false
/usr/bin/env git fetch origin
fatal: couldn't find remote ref refs/heads/master
Error: libangle: Failed to download resource "libangle"
Failure while executing; `/usr/bin/env git fetch origin` exited with 128. Here's the output:
fatal: couldn't find remote ref refs/heads/master

What did you expect to happen?

I expect to be able to define main at least in the custom strategy:

equire "download_strategy"

class NoSubmoduleGitDownloadStrategy < GitDownloadStrategy
  def stage
    # Set environment configuration to force detached head advice
    system "git", "config", "advice.detachedHead", "true"
    # Ensure submodules are not initialized or updated
    system "git", "config", "--local", "submodule.recurse", "false"
    # Fetch the main branch explicitly
    system "git", "config", "--replace-all", "remote.origin.fetch", "+refs/heads/main:refs/remotes/origin/main"
    system "git", "fetch", "origin", "main"
    system "git", "checkout", "main"
    super
  end

Step-by-step reproduction instructions (by running brew commands)

brew tap startergo/qemu-virgl
brew install libangle
@startergo
Copy link
Author

startergo commented Mar 11, 2025

Opened an issue in homebrew-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant