ok/jj
1
0
Fork 0
forked from mirrors/jj

working_copy: mark commit_id field in proto reserved

By marking it reserved, we prevent accidental use. We can still read
working copy protos that have the field.
This commit is contained in:
Martin von Zweigbergk 2024-01-12 16:25:01 -08:00 committed by Martin von Zweigbergk
parent 543036c753
commit a66e2a0a6d
3 changed files with 1 additions and 11 deletions

View file

@ -1533,7 +1533,6 @@ impl LocalWorkingCopy {
let proto = crate::protos::working_copy::Checkout {
operation_id: operation_id.to_bytes(),
workspace_id: workspace_id.as_str().to_string(),
..Default::default()
};
let mut file = OpenOptions::new()
.create_new(true)
@ -1638,7 +1637,6 @@ impl LocalWorkingCopy {
self.write_proto(crate::protos::working_copy::Checkout {
operation_id: self.operation_id().to_bytes(),
workspace_id: self.workspace_id().as_str().to_string(),
..Default::default()
});
}

View file

@ -66,8 +66,5 @@ message Checkout {
// TODO: Is it better to make this a UUID and a have map that to a name in
// config? That way users can rename a workspace.
string workspace_id = 3;
// The checked-out commit, which can be viewed as a cache of the working-copy
// commit ID recorded in `operation_id`'s operation. No longer used.
// TODO: Delete this mid 2022 or so
bytes commit_id = 1;
reserved 1;
}

View file

@ -71,11 +71,6 @@ pub struct Checkout {
/// config? That way users can rename a workspace.
#[prost(string, tag = "3")]
pub workspace_id: ::prost::alloc::string::String,
/// The checked-out commit, which can be viewed as a cache of the working-copy
/// commit ID recorded in `operation_id`'s operation. No longer used.
/// TODO: Delete this mid 2022 or so
#[prost(bytes = "vec", tag = "1")]
pub commit_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]