mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-01 04:14:45 +03:00
store empty deltas anyway
This commit is contained in:
parent
7fcf60a735
commit
4c5f52ee6d
@ -227,9 +227,6 @@ pub fn save_current_file_deltas(
|
|||||||
file_path: &Path,
|
file_path: &Path,
|
||||||
deltas: &Vec<Delta>,
|
deltas: &Vec<Delta>,
|
||||||
) -> Result<(), std::io::Error> {
|
) -> Result<(), std::io::Error> {
|
||||||
if deltas.is_empty() {
|
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
let project_deltas_path = project_path.join(".git/gb/session/deltas");
|
let project_deltas_path = project_path.join(".git/gb/session/deltas");
|
||||||
std::fs::create_dir_all(&project_deltas_path)?;
|
std::fs::create_dir_all(&project_deltas_path)?;
|
||||||
let delta_path = project_deltas_path.join(file_path);
|
let delta_path = project_deltas_path.join(file_path);
|
||||||
@ -237,7 +234,6 @@ pub fn save_current_file_deltas(
|
|||||||
let raw_deltas = serde_json::to_string(&deltas)?;
|
let raw_deltas = serde_json::to_string(&deltas)?;
|
||||||
std::fs::write(delta_path, raw_deltas)?;
|
std::fs::write(delta_path, raw_deltas)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn list_current_deltas(project_path: &Path) -> Result<HashMap<String, Vec<Delta>>, Error> {
|
pub fn list_current_deltas(project_path: &Path) -> Result<HashMap<String, Vec<Delta>>, Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user