summaryrefslogtreecommitdiffstats
path: root/src/commit/file_stat.rs
blob: 5b9342b50d1d5a47719d1414aa3f1083e4b829a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use git2::Delta;

#[derive(Debug, PartialEq)]
pub(crate) struct FileStat {
	status: Delta,
	to_name: String,
	from_name: String,
}

impl FileStat {
	pub(super) fn new(from_name: String, to_name: String, status: Delta) -> Self {
		FileStat {
			status,
			to_name,
			from_name,
		}
	}

	pub(crate) fn get_status(&self) -> &Delta {
		&self.status
	}

	pub(crate) fn get_to_name(&self) -> &String {
		&self.to_name
	}

	pub(crate) fn get_from_name(&self) -> &String {
		&self.from_name
	}
}