File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ pub mod snapshot {
160160 /// The snapshot to restore
161161 snapshot_id : String ,
162162 } ,
163+ /// Show what is stored in a given snapshot.
164+ Diff {
165+ /// The hex-hash of the commit-id of the snapshot.
166+ snapshot_id : String ,
167+ } ,
163168 }
164169}
165170
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ pub mod prepare;
22pub mod project;
33pub mod vbranch;
44pub mod snapshot {
5+ use crate :: command:: debug_print;
56 use anyhow:: Result ;
67 use gitbutler_oplog:: OplogExt ;
78 use gitbutler_project:: Project ;
@@ -23,6 +24,10 @@ pub mod snapshot {
2324 project. restore_snapshot ( snapshot_id. parse ( ) ?) ?;
2425 Ok ( ( ) )
2526 }
27+
28+ pub fn diff ( project : Project , snapshot_id : String ) -> Result < ( ) > {
29+ debug_print ( project. snapshot_diff ( snapshot_id. parse ( ) ?) )
30+ }
2631}
2732
2833fn debug_print ( this : impl std:: fmt:: Debug ) -> anyhow:: Result < ( ) > {
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ fn main() -> Result<()> {
8585 Some ( snapshot:: SubCommands :: Restore { snapshot_id } ) => {
8686 command:: snapshot:: restore ( project, snapshot_id)
8787 }
88+ Some ( snapshot:: SubCommands :: Diff { snapshot_id } ) => {
89+ command:: snapshot:: diff ( project, snapshot_id)
90+ }
8891 None => command:: snapshot:: list ( project) ,
8992 }
9093 }
You can’t perform that action at this time.
0 commit comments