mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Ignore user config when checking remote git URL for dev extensions (#52538)
## Context Fixes #48163 Also update the logic from `git remote -v` + manually parse => `git remote get-url origin` Not sure the best way to test this ## How to Review <!-- Help reviewers focus their attention: - For small PRs: note what to focus on (e.g., "error handling in foo.rs") - For large PRs (>400 LOC): provide a guided tour — numbered list of files/commits to read in order. (The `large-pr` label is applied automatically.) - See the review process guidelines for comment conventions --> ## Self-Review Checklist <!-- Check before requesting review: --> - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed rebuilding dev extensions when user git config contains url rewriting rules
This commit is contained in:
parent
90fcf8539e
commit
0b984b5ade
1 changed files with 3 additions and 7 deletions
|
|
@ -296,16 +296,12 @@ impl ExtensionBuilder {
|
|||
let remotes_output = util::command::new_command("git")
|
||||
.arg("--git-dir")
|
||||
.arg(&git_dir)
|
||||
.args(["remote", "-v"])
|
||||
.args(["remote", "get-url", "origin"])
|
||||
.env("GIT_CONFIG_GLOBAL", "/dev/null")
|
||||
.output()
|
||||
.await?;
|
||||
let has_remote = remotes_output.status.success()
|
||||
&& String::from_utf8_lossy(&remotes_output.stdout)
|
||||
.lines()
|
||||
.any(|line| {
|
||||
let mut parts = line.split(|c: char| c.is_whitespace());
|
||||
parts.next() == Some("origin") && parts.any(|part| part == url)
|
||||
});
|
||||
&& String::from_utf8_lossy(&remotes_output.stdout).trim() == url;
|
||||
if !has_remote {
|
||||
bail!(
|
||||
"grammar directory '{}' already exists, but is not a git clone of '{}'",
|
||||
|
|
|
|||
Loading…
Reference in a new issue