Build history options from command settings. Converts the command's settings into `HistoryOptions` for querying the repository. # Returns `HistoryOptions` configured according to command settings.
(&self)
| 211 | /// |
| 212 | /// `HistoryOptions` configured according to command settings. |
| 213 | pub(crate) fn build_history_options(&self) -> HistoryOptions { |
| 214 | let mut options = HistoryOptions::new().load_headers(true); |
| 215 | |
| 216 | if let Some(count) = self.count { |
| 217 | options = options.limit(count); |
| 218 | } |
| 219 | |
| 220 | if let Some(ref view) = self.view { |
| 221 | options = options.view(view.clone()); |
| 222 | } |
| 223 | |
| 224 | if self.tags_only { |
| 225 | options = options.tagged_only(true); |
| 226 | } |
| 227 | |
| 228 | if let Some(from) = self.from { |
| 229 | options = options.from_sequence(from); |
| 230 | } |
| 231 | |
| 232 | if self.all { |
| 233 | options = options.include_inherited(true); |
| 234 | } |
| 235 | |
| 236 | options |
| 237 | } |
| 238 | |
| 239 | /// Get the hash display length based on settings. |
| 240 | /// |