Add git init button (#26522)

Because why not

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-03-12 00:25:19 -07:00 committed by GitHub
parent 050f5f6723
commit 036c123488
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 429 additions and 83 deletions

View file

@ -841,12 +841,12 @@ impl Project {
});
let git_store = cx.new(|cx| {
GitStore::new(
GitStore::local(
&worktree_store,
buffer_store.clone(),
Some(environment.clone()),
environment.clone(),
fs.clone(),
client.clone().into(),
None,
cx,
)
});
@ -970,12 +970,12 @@ impl Project {
cx.subscribe(&lsp_store, Self::on_lsp_store_event).detach();
let git_store = cx.new(|cx| {
GitStore::new(
GitStore::ssh(
&worktree_store,
buffer_store.clone(),
Some(environment.clone()),
environment.clone(),
ssh_proto.clone(),
Some(ProjectId(SSH_PROJECT_ID)),
ProjectId(SSH_PROJECT_ID),
cx,
)
});
@ -1177,12 +1177,12 @@ impl Project {
})?;
let git_store = cx.new(|cx| {
GitStore::new(
GitStore::remote(
// In this remote case we pass None for the environment
&worktree_store,
buffer_store.clone(),
None,
client.clone().into(),
Some(ProjectId(remote_id)),
ProjectId(remote_id),
cx,
)
})?;
@ -4443,6 +4443,17 @@ impl Project {
})
}
pub fn git_init(
&self,
path: Arc<Path>,
fallback_branch_name: String,
cx: &App,
) -> Task<Result<()>> {
self.git_store
.read(cx)
.git_init(path, fallback_branch_name, cx)
}
pub fn buffer_store(&self) -> &Entity<BufferStore> {
&self.buffer_store
}