File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,11 @@ pub(crate) fn restore_to_oplog(
122
122
oplog_sha : & str ,
123
123
) -> anyhow:: Result < ( ) > {
124
124
let project = Project :: find_by_path ( repo_path) ?;
125
+ let snapshots = but_api:: undo:: list_snapshots ( project. id , 100 , None , None ) ?;
125
126
126
127
// Parse the oplog SHA (support partial SHAs)
127
128
let commit_sha_string = if oplog_sha. len ( ) >= 7 {
128
129
// Try to find a snapshot that starts with this SHA
129
- let snapshots = but_api:: undo:: list_snapshots ( project. id , 100 , None , None ) ?;
130
130
131
131
let matching_snapshot = snapshots
132
132
. iter ( )
@@ -139,7 +139,6 @@ pub(crate) fn restore_to_oplog(
139
139
} ;
140
140
141
141
// Get information about the target snapshot
142
- let snapshots = but_api:: undo:: list_snapshots ( project. id , 100 , None , None ) ?;
143
142
let target_snapshot = snapshots
144
143
. iter ( )
145
144
. find ( |snapshot| snapshot. commit_id . to_string ( ) == commit_sha_string)
You can’t perform that action at this time.
0 commit comments