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
31
32
33
34
use crate::{Object, RevparseMode};
pub struct Revspec<'repo> {
from: Option<Object<'repo>>,
to: Option<Object<'repo>>,
mode: RevparseMode,
}
impl<'repo> Revspec<'repo> {
pub fn from_objects(
from: Option<Object<'repo>>,
to: Option<Object<'repo>>,
mode: RevparseMode,
) -> Revspec<'repo> {
Revspec { from, to, mode }
}
pub fn from(&self) -> Option<&Object<'repo>> {
self.from.as_ref()
}
pub fn to(&self) -> Option<&Object<'repo>> {
self.to.as_ref()
}
pub fn mode(&self) -> RevparseMode {
self.mode
}
}