Move git state to Project (#23208)

This restores its visibility outside of git_ui, which we'll need soon,
while preserving its per-project character.

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-01-16 13:57:28 -05:00 committed by GitHub
parent 614eaec278
commit b7726238ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 363 additions and 317 deletions

View file

@ -7,6 +7,7 @@ pub mod repository;
pub mod status;
use anyhow::{anyhow, Context, Result};
use gpui::actions;
use serde::{Deserialize, Serialize};
use std::ffi::OsStr;
use std::fmt;
@ -24,6 +25,24 @@ pub static FSMONITOR_DAEMON: LazyLock<&'static OsStr> =
LazyLock::new(|| OsStr::new("fsmonitor--daemon"));
pub static GITIGNORE: LazyLock<&'static OsStr> = LazyLock::new(|| OsStr::new(".gitignore"));
actions!(
git,
[
StageFile,
UnstageFile,
ToggleStaged,
// Revert actions are currently in the editor crate:
// editor::RevertFile,
// editor::RevertSelectedHunks
StageAll,
UnstageAll,
RevertAll,
CommitChanges,
CommitAllChanges,
ClearCommitMessage
]
);
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct Oid(libgit::Oid);