From 002f77b3d7f6d89cb53f7cb0fe4609b5773efde5 Mon Sep 17 00:00:00 2001 From: mulla028 Date: Mon, 25 Nov 2024 18:15:41 -0500 Subject: [PATCH] Implementation of new_from_stdin() moved inside of main.rs, new_from_stdin() deleted --- src/git_entity/commit.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/git_entity/commit.rs b/src/git_entity/commit.rs index 934cebd..75aa1bb 100644 --- a/src/git_entity/commit.rs +++ b/src/git_entity/commit.rs @@ -1,5 +1,4 @@ use crate::error::LumenError; -use std::io::Read; use std::process::Command; use thiserror::Error; @@ -36,18 +35,6 @@ impl Commit { }) } - pub fn new_from_stdin() -> Result { - let mut buffer = String::new(); - std::io::stdin() - .read_to_string(&mut buffer) - .map_err(LumenError::from)?; - - eprintln!("Reading commit SHA from stdin: '{}'", buffer.trim()); - - // Assuming you want to create the commit based on the SHA read from stdin - Commit::new(buffer.trim().to_string()) - } - pub fn is_valid_commit(sha: &str) -> Result<(), LumenError> { let output = Command::new("git").args(["cat-file", "-t", sha]).output()?; let output_str = String::from_utf8(output.stdout)?;