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)
| 209 | /// |
| 210 | /// `HistoryOptions` configured according to command settings. |
| 211 | pub(crate) fn build_history_options(&self) -> HistoryOptions { |
| 212 | let mut options = HistoryOptions::new().load_headers(true); |
| 213 | |
| 214 | if let Some(count) = self.count { |
| 215 | options = options.limit(count); |
| 216 | } |
| 217 | |
| 218 | if let Some(ref view) = self.view { |
| 219 | options = options.view(view.clone()); |
| 220 | } |
| 221 | |
| 222 | if self.tags_only { |
| 223 | options = options.tagged_only(true); |
| 224 | } |
| 225 | |
| 226 | if let Some(from) = self.from { |
| 227 | options = options.from_sequence(from); |
| 228 | } |
| 229 | |
| 230 | if self.all { |
| 231 | options = options.include_inherited(true); |
| 232 | } |
| 233 | |
| 234 | options |
| 235 | } |
| 236 | |
| 237 | /// Get the hash display length based on settings. |
| 238 | /// |