parent
f3274851d9
commit
d5cc576b0c
1 changed files with 11 additions and 11 deletions
|
@ -2941,7 +2941,7 @@ impl BackgroundScannerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn remove_path(&mut self, path: &Path) {
|
fn remove_path(&mut self, path: &Path) {
|
||||||
log::debug!("background scanner removing path {path:?}");
|
log::trace!("background scanner removing path {path:?}");
|
||||||
let mut new_entries;
|
let mut new_entries;
|
||||||
let removed_entries;
|
let removed_entries;
|
||||||
{
|
{
|
||||||
|
@ -3011,12 +3011,12 @@ impl BackgroundScannerState {
|
||||||
Some(parent_dir) => {
|
Some(parent_dir) => {
|
||||||
// Guard against repositories inside the repository metadata
|
// Guard against repositories inside the repository metadata
|
||||||
if parent_dir.iter().any(|component| component == *DOT_GIT) {
|
if parent_dir.iter().any(|component| component == *DOT_GIT) {
|
||||||
log::info!(
|
log::debug!(
|
||||||
"not building git repository for nested `.git` directory, `.git` path in the worktree: {dot_git_path:?}"
|
"not building git repository for nested `.git` directory, `.git` path in the worktree: {dot_git_path:?}"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
log::info!(
|
log::debug!(
|
||||||
"building git repository, `.git` path in the worktree: {dot_git_path:?}"
|
"building git repository, `.git` path in the worktree: {dot_git_path:?}"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3025,7 +3025,7 @@ impl BackgroundScannerState {
|
||||||
None => {
|
None => {
|
||||||
// `dot_git_path.parent().is_none()` means `.git` directory is the opened worktree itself,
|
// `dot_git_path.parent().is_none()` means `.git` directory is the opened worktree itself,
|
||||||
// no files inside that directory are tracked by git, so no need to build the repo around it
|
// no files inside that directory are tracked by git, so no need to build the repo around it
|
||||||
log::info!(
|
log::debug!(
|
||||||
"not building git repository for the worktree itself, `.git` path in the worktree: {dot_git_path:?}"
|
"not building git repository for the worktree itself, `.git` path in the worktree: {dot_git_path:?}"
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
@ -3049,7 +3049,7 @@ impl BackgroundScannerState {
|
||||||
fs: &dyn Fs,
|
fs: &dyn Fs,
|
||||||
watcher: &dyn Watcher,
|
watcher: &dyn Watcher,
|
||||||
) -> Option<LocalRepositoryEntry> {
|
) -> Option<LocalRepositoryEntry> {
|
||||||
log::info!("insert git repository for {dot_git_path:?}");
|
log::trace!("insert git repository for {dot_git_path:?}");
|
||||||
let work_dir_entry = self.snapshot.entry_for_path(work_directory.path_key().0)?;
|
let work_dir_entry = self.snapshot.entry_for_path(work_directory.path_key().0)?;
|
||||||
let work_directory_abs_path = self
|
let work_directory_abs_path = self
|
||||||
.snapshot
|
.snapshot
|
||||||
|
@ -3062,7 +3062,7 @@ impl BackgroundScannerState {
|
||||||
.get(&work_dir_entry.id)
|
.get(&work_dir_entry.id)
|
||||||
.is_some()
|
.is_some()
|
||||||
{
|
{
|
||||||
log::info!("existing git repository for {work_directory:?}");
|
log::trace!("existing git repository for {work_directory:?}");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3071,7 +3071,7 @@ impl BackgroundScannerState {
|
||||||
// TODO add these watchers without building a whole repository by parsing .git-with-indirection
|
// TODO add these watchers without building a whole repository by parsing .git-with-indirection
|
||||||
let t0 = Instant::now();
|
let t0 = Instant::now();
|
||||||
let repository = fs.open_repo(&dot_git_abs_path)?;
|
let repository = fs.open_repo(&dot_git_abs_path)?;
|
||||||
log::info!("opened git repo for {dot_git_abs_path:?}");
|
log::trace!("opened git repo for {dot_git_abs_path:?}");
|
||||||
|
|
||||||
let repository_path = repository.path();
|
let repository_path = repository.path();
|
||||||
watcher.add(&repository_path).log_err()?;
|
watcher.add(&repository_path).log_err()?;
|
||||||
|
@ -3112,7 +3112,7 @@ impl BackgroundScannerState {
|
||||||
.git_repositories
|
.git_repositories
|
||||||
.insert(work_directory_id, local_repository.clone());
|
.insert(work_directory_id, local_repository.clone());
|
||||||
|
|
||||||
log::info!("inserting new local git repository");
|
log::trace!("inserting new local git repository");
|
||||||
Some(local_repository)
|
Some(local_repository)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3786,7 +3786,7 @@ impl BackgroundScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
let ancestor_dot_git = ancestor.join(*DOT_GIT);
|
let ancestor_dot_git = ancestor.join(*DOT_GIT);
|
||||||
log::info!("considering ancestor: {ancestor_dot_git:?}");
|
log::trace!("considering ancestor: {ancestor_dot_git:?}");
|
||||||
// Check whether the directory or file called `.git` exists (in the
|
// Check whether the directory or file called `.git` exists (in the
|
||||||
// case of worktrees it's a file.)
|
// case of worktrees it's a file.)
|
||||||
if self
|
if self
|
||||||
|
@ -4247,7 +4247,7 @@ impl BackgroundScanner {
|
||||||
log::error!("skipping excluded directory {:?}", job.path);
|
log::error!("skipping excluded directory {:?}", job.path);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
log::info!("scanning directory {:?}", job.path);
|
log::trace!("scanning directory {:?}", job.path);
|
||||||
root_abs_path = snapshot.abs_path().clone();
|
root_abs_path = snapshot.abs_path().clone();
|
||||||
root_char_bag = snapshot.root_char_bag;
|
root_char_bag = snapshot.root_char_bag;
|
||||||
}
|
}
|
||||||
|
@ -4717,7 +4717,7 @@ impl BackgroundScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_git_repositories(&self, dot_git_paths: Vec<PathBuf>) {
|
fn update_git_repositories(&self, dot_git_paths: Vec<PathBuf>) {
|
||||||
log::info!("reloading repositories: {dot_git_paths:?}");
|
log::trace!("reloading repositories: {dot_git_paths:?}");
|
||||||
let mut state = self.state.lock();
|
let mut state = self.state.lock();
|
||||||
let scan_id = state.snapshot.scan_id;
|
let scan_id = state.snapshot.scan_id;
|
||||||
for dot_git_dir in dot_git_paths {
|
for dot_git_dir in dot_git_paths {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue