Directly parse .git when it's a file instead of using libgit2 (#27885)
Avoids building a whole git2 repository object at the worktree layer just to watch some additional paths. - [x] Tidy up names of the various paths - [x] Tests for worktrees and submodules Release Notes: - N/A
This commit is contained in:
parent
429d4580cf
commit
055df30757
7 changed files with 401 additions and 160 deletions
|
@ -229,12 +229,6 @@ pub trait GitRepository: Send + Sync {
|
|||
/// worktree's gitdir within the main repository (typically `.git/worktrees/<name>`).
|
||||
fn path(&self) -> PathBuf;
|
||||
|
||||
/// Returns the absolute path to the ".git" dir for the main repository, typically a `.git`
|
||||
/// folder. For worktrees, this will be the path to the repository the worktree was created
|
||||
/// from. Otherwise, this is the same value as `path()`.
|
||||
///
|
||||
/// Git documentation calls this the "commondir", and for git CLI is overridden by
|
||||
/// `GIT_COMMON_DIR`.
|
||||
fn main_repository_path(&self) -> PathBuf;
|
||||
|
||||
/// Updates the index to match the worktree at the given paths.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue