mirror of
https://github.com/jnsahaj/lumen.git
synced 2025-12-23 05:36:48 +00:00
Implementation of new_from_stdin() moved inside of main.rs, new_from_stdin() deleted
This commit is contained in:
parent
05949aa378
commit
002f77b3d7
1 changed files with 0 additions and 13 deletions
|
|
@ -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<Self, LumenError> {
|
||||
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)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue