mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
refactor: update git index refresh to a no-op and change logging level to debug
The `refresh_git_index` function is now a no-op, as the previous implementation added unnecessary latency without meaningful benefits. Additionally, logging levels for performance metrics have been changed from info to debug across various modules to reduce verbosity and improve performance during normal operations.
This commit is contained in:
parent
3666c2a5e1
commit
a2c7968c60
6 changed files with 28 additions and 59 deletions
28
src/git.rs
28
src/git.rs
|
|
@ -674,31 +674,9 @@ pub fn compute_git_metadata(
|
|||
|
||||
/// Refreshes the git index if the project is in a git repository.
|
||||
///
|
||||
/// This is useful because syncback may rewrite files with identical content,
|
||||
/// which can cause git to report them as modified due to timestamp changes.
|
||||
pub fn refresh_git_index(project_dir: &Path) {
|
||||
log::info!("Refreshing git index...");
|
||||
let output = match Command::new("git")
|
||||
.args(["update-index", "--refresh"])
|
||||
.current_dir(project_dir)
|
||||
.output()
|
||||
{
|
||||
Ok(o) => o,
|
||||
Err(e) => {
|
||||
log::debug!("Failed to run git update-index --refresh: {}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if output.status.success() {
|
||||
log::info!("Git index refreshed.");
|
||||
} else {
|
||||
log::warn!(
|
||||
"git update-index --refresh failed: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
}
|
||||
}
|
||||
/// Currently a no-op -- `git update-index --refresh` adds latency without
|
||||
/// meaningful benefit since we already skip unchanged files via hash comparison.
|
||||
pub fn refresh_git_index(_project_dir: &Path) {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue