diff --git a/backend/src/git.rs b/backend/src/git.rs index 794703f2..ef449106 100644 --- a/backend/src/git.rs +++ b/backend/src/git.rs @@ -2,7 +2,7 @@ use color_eyre::eyre::{bail, ContextCompat}; use color_eyre::{eyre::Context, Result}; -use git2::{AnnotatedCommit, FetchOptions, Index, Oid, Repository, Signature}; +use git2::{AnnotatedCommit, FetchOptions, Oid, Repository, Signature}; use serde::{Deserialize, Serialize}; use std::fs; use std::io::{Read, Write}; @@ -153,7 +153,7 @@ impl Interface { ); // Standard practice is to stage commits by adding them to an index. relative_path.push(path); - let _guard = Self::git_add(&repo, relative_path)?; + Self::git_add(&repo, relative_path)?; let commit_id = Self::git_commit(&repo, msg, None)?; debug!("New commit made with ID: {:?}", commit_id); Self::git_push(&repo, token)?; @@ -194,18 +194,11 @@ impl Interface { } /// A code level re-implementation of `git add`. - /// - /// This function returns an RAII guard attached to the index, the file path specified - /// will only be in the index as long as that guard is in scope. As soon as the guard leaves scope, - /// the file path is removed from the index, and changes made will not be tracked. - fn git_add>(repo: &Repository, path: P) -> Result { + fn git_add>(repo: &Repository, path: P) -> Result<()> { let mut index = repo.index()?; index.add_path(path.as_ref())?; index.write()?; - Ok(IndexPathGuard { - index, - path: path.as_ref().into(), - }) + Ok(()) } /// A code level re-implementation of `git commit`. @@ -395,17 +388,3 @@ impl Interface { .map_err(|_| git2::Error::from_str("Couldn't find commit")) } } - -/// An RAII guard associated with a path currently added to the index. -/// When dropped, the file is removed from the index. -struct IndexPathGuard { - index: Index, - path: PathBuf, -} - -impl Drop for IndexPathGuard { - fn drop(&mut self) { - self.index.remove_path(&self.path).unwrap(); - self.index.write().unwrap(); - } -} diff --git a/backend/src/main.rs b/backend/src/main.rs index f53691c1..6a400b42 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -200,7 +200,6 @@ async fn main() -> Result<()> { .extensions() .get::() .map(MatchedPath::as_str); - println!("Path: {:?}", matched_path); info_span!( "http_request", method = ?request.method(), diff --git a/frontend/src/lib/components/FileNavigation.svelte b/frontend/src/lib/components/FileNavigation.svelte index 95d718a0..150b4eb3 100644 --- a/frontend/src/lib/components/FileNavigation.svelte +++ b/frontend/src/lib/components/FileNavigation.svelte @@ -1,6 +1,6 @@ @@ -122,7 +124,6 @@ last_modified_date: ${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()} ---\n\n` ); currentFile.set(path + newFileInput.value); - console.log(cache.get(get(currentFile))); } if (e.key === 'Escape') { showNewFileInput = false;