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)
| 188 | /// |
| 189 | /// `HistoryOptions` configured according to command settings. |
| 190 | pub(crate) fn build_history_options(&self) -> HistoryOptions { |
| 191 | let mut options = HistoryOptions::new().load_headers(true); |
| 192 | |
| 193 | if let Some(count) = self.count { |
| 194 | options = options.limit(count); |
| 195 | } |
| 196 | |
| 197 | if let Some(ref view) = self.view { |
| 198 | options = options.view(view.clone()); |
| 199 | } |
| 200 | |
| 201 | if self.tags_only { |
| 202 | options = options.tagged_only(true); |
| 203 | } |
| 204 | |
| 205 | if let Some(from) = self.from { |
| 206 | options = options.from_sequence(from); |
| 207 | } |
| 208 | |
| 209 | if self.all { |
| 210 | options = options.include_inherited(true); |
| 211 | } |
| 212 | |
| 213 | options |
| 214 | } |
| 215 | |
| 216 | /// Get the hash display length based on settings. |
| 217 | /// |