File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -133,15 +133,15 @@ impl Commit {
133133
134134 // Make sure the one creating the commit had the same idea of what the current state is.
135135 if !is_new && opts. validate_previous_commit {
136- if let Ok ( last_resource_val ) = resource_old. get ( urls:: LAST_COMMIT ) {
137- let prev_resource = last_resource_val . to_string ( ) ;
136+ if let Ok ( last_commit_val ) = resource_old. get ( urls:: LAST_COMMIT ) {
137+ let last_commit = last_commit_val . to_string ( ) ;
138138
139- if let Some ( commit_prev ) = self . previous_commit . clone ( ) {
139+ if let Some ( prev_commit ) = self . previous_commit . clone ( ) {
140140 // TODO: try auto merge
141- if prev_resource != commit_prev {
141+ if last_commit != prev_commit {
142142 return Err ( format ! (
143143 "previousCommit mismatch. Had lastCommit '{}' in Resource {}, but got in Commit '{}'. Perhaps you created the Commit based on an outdated version of the Resource." ,
144- prev_resource , subject_url, commit_prev ,
144+ last_commit , subject_url, prev_commit ,
145145 )
146146 . into ( ) ) ;
147147 }
Original file line number Diff line number Diff line change @@ -307,7 +307,8 @@ impl Resource {
307307 validate_signature : false ,
308308 validate_timestamp : false ,
309309 validate_rights : false ,
310- validate_previous_commit : true ,
310+ // TODO: auto-merge should work before we enable this https://github.com/atomicdata-dev/atomic-data-rust/issues/412
311+ validate_previous_commit : false ,
311312 update_index : true ,
312313 } ;
313314 let commit_response = commit. apply_opts ( store, & opts) ?;
@@ -333,7 +334,8 @@ impl Resource {
333334 validate_signature : false ,
334335 validate_timestamp : false ,
335336 validate_rights : false ,
336- validate_previous_commit : true ,
337+ // https://github.com/atomicdata-dev/atomic-data-rust/issues/412
338+ validate_previous_commit : false ,
337339 update_index : true ,
338340 } ;
339341 let commit_response = commit. apply_opts ( store, & opts) ?;
You can’t perform that action at this time.
0 commit comments