26d9828feat: password hashing behind a port1mo | 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
47db238feat: serve the git protocol through http-backend, behind a port8d | 6 | use std::{path::PathBuf, pin::Pin}; |
| 7 | |
| 8 | use tokio::io::AsyncRead; |
02eb2e4feat: GitStorage port and DiskGitStorage24d | 9 | |
dce0bf3feat: browse a repository's files and history8d | 10 | use crate::domain::{ |
2268309feat: a commit is a page, and two revisions can be compared20h | 11 | BranchRow, CommitDetail, CommitSummary, DomainError, GitRef, GrepHit, ObjectId, OrgName, |
| 12 | PasswordHash, RefName, RepoName, RepoPath, TagRow, TagSummary, TreeEntry, |
dce0bf3feat: browse a repository's files and history8d | 13 | }; |
26d9828feat: password hashing behind a port1mo | 14 | |
5727ed7feat: who last changed each line, as a thing the port can answer20h | 15 | use super::blame::Blame; |
| 16 | |
26d9828feat: password hashing behind a port1mo | 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | pub trait PasswordHasher: Send + Sync { |
| 23 | |
| 24 | fn hash(&self, plaintext: &str) -> Result<PasswordHash, PasswordError>; |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | fn verify(&self, plaintext: &str, hash: &PasswordHash) -> Result<bool, PasswordError>; |
| 32 | } |
| 33 | |
| 34 | |
| 35 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 36 | pub struct PasswordError(String); |
| 37 | |
| 38 | impl PasswordError { |
| 39 | pub fn new(message: impl Into<String>) -> Self { |
| 40 | Self(message.into()) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | impl std::fmt::Display for PasswordError { |
| 45 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 46 | write!(f, "password hashing failed: {}", self.0) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | impl std::error::Error for PasswordError {} |
02eb2e4feat: GitStorage port and DiskGitStorage24d | 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | pub trait GitStorage: Send + Sync { |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | fn init_bare( |
| 72 | &self, |
| 73 | handle: &OrgName, |
| 74 | name: &RepoName, |
| 75 | ) -> impl Future<Output = Result<(), GitStorageError>> + Send; |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | fn remove( |
| 83 | &self, |
| 84 | handle: &OrgName, |
| 85 | name: &RepoName, |
| 86 | ) -> impl Future<Output = Result<(), GitStorageError>> + Send; |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | fn repo_path(&self, handle: &OrgName, name: &RepoName) -> PathBuf; |
| 93 | } |
| 94 | |
| 95 | |
| 96 | #[derive(Debug)] |
| 97 | pub enum GitStorageError { |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | AlreadyExists, |
| 104 | |
| 105 | Backend(Box<dyn std::error::Error + Send + Sync>), |
| 106 | } |
| 107 | |
| 108 | impl GitStorageError { |
| 109 | pub fn backend(error: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> Self { |
| 110 | Self::Backend(error.into()) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | impl std::fmt::Display for GitStorageError { |
| 115 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 116 | match self { |
| 117 | Self::AlreadyExists => f.write_str("a repository already exists at that path"), |
| 118 | Self::Backend(error) => write!(f, "git storage failure: {error}"), |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | impl std::error::Error for GitStorageError { |
| 124 | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { |
| 125 | match self { |
| 126 | Self::AlreadyExists => None, |
| 127 | Self::Backend(error) => Some(&**error), |
| 128 | } |
| 129 | } |
| 130 | } |
47db238feat: serve the git protocol through http-backend, behind a port8d | 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | pub type ByteStream = Pin<Box<dyn AsyncRead + Send>>; |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 145 | pub enum GitMethod { |
| 146 | Get, |
| 147 | Post, |
| 148 | } |
| 149 | |
| 150 | impl GitMethod { |
| 151 | pub fn as_str(self) -> &'static str { |
| 152 | match self { |
| 153 | Self::Get => "GET", |
| 154 | Self::Post => "POST", |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | pub struct GitRequest { |
| 168 | pub method: GitMethod, |
| 169 | |
| 170 | pub path_info: String, |
| 171 | |
| 172 | pub query: String, |
| 173 | pub content_type: Option<String>, |
| 174 | |
| 175 | |
| 176 | |
| 177 | pub content_encoding: Option<String>, |
| 178 | pub content_length: Option<String>, |
| 179 | |
| 180 | |
| 181 | pub git_protocol: Option<String>, |
a814db5feat: push and clone private repositories with a token8d | 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | pub allow_receive_pack: bool, |
47db238feat: serve the git protocol through http-backend, behind a port8d | 190 | pub body: ByteStream, |
| 191 | } |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | pub struct GitResponse { |
| 199 | pub status: u16, |
| 200 | pub headers: Vec<(String, String)>, |
| 201 | pub body: ByteStream, |
| 202 | } |
| 203 | |
8ac00bdfeat: decide who may reach the git protocol8d | 204 | |
| 205 | |
| 206 | impl std::fmt::Debug for GitRequest { |
| 207 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 208 | f.debug_struct("GitRequest") |
| 209 | .field("method", &self.method) |
| 210 | .field("path_info", &self.path_info) |
| 211 | .field("query", &self.query) |
| 212 | .field("content_type", &self.content_type) |
| 213 | .field("content_encoding", &self.content_encoding) |
| 214 | .field("content_length", &self.content_length) |
| 215 | .field("git_protocol", &self.git_protocol) |
a814db5feat: push and clone private repositories with a token8d | 216 | .field("allow_receive_pack", &self.allow_receive_pack) |
8ac00bdfeat: decide who may reach the git protocol8d | 217 | .finish_non_exhaustive() |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | impl std::fmt::Debug for GitResponse { |
| 222 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 223 | f.debug_struct("GitResponse") |
| 224 | .field("status", &self.status) |
| 225 | .field("headers", &self.headers) |
| 226 | .finish_non_exhaustive() |
| 227 | } |
| 228 | } |
| 229 | |
47db238feat: serve the git protocol through http-backend, behind a port8d | 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | pub trait GitProtocolServer: Send + Sync { |
| 235 | fn serve( |
| 236 | &self, |
| 237 | request: GitRequest, |
| 238 | ) -> impl Future<Output = Result<GitResponse, GitProtocolError>> + Send; |
| 239 | } |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | #[derive(Debug)] |
| 247 | pub struct GitProtocolError(Box<dyn std::error::Error + Send + Sync>); |
| 248 | |
| 249 | impl GitProtocolError { |
| 250 | pub fn new(error: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> Self { |
| 251 | Self(error.into()) |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | impl std::fmt::Display for GitProtocolError { |
| 256 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 257 | write!(f, "git protocol failure: {}", self.0) |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | impl std::error::Error for GitProtocolError { |
| 262 | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { |
| 263 | Some(&*self.0) |
| 264 | } |
| 265 | } |
dce0bf3feat: browse a repository's files and history8d | 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 273 | pub struct Blob { |
| 274 | pub id: ObjectId, |
| 275 | pub size: u64, |
| 276 | pub content: Option<Vec<u8>>, |
| 277 | } |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | pub trait GitQuery: Send + Sync { |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | fn default_branch( |
| 300 | &self, |
| 301 | handle: &OrgName, |
| 302 | name: &RepoName, |
| 303 | ) -> impl Future<Output = Result<Option<RefName>, GitQueryError>> + Send; |
| 304 | |
| 305 | |
| 306 | fn resolve( |
| 307 | &self, |
| 308 | handle: &OrgName, |
| 309 | name: &RepoName, |
| 310 | rev: &RefName, |
| 311 | ) -> impl Future<Output = Result<Option<ObjectId>, GitQueryError>> + Send; |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | fn list_tree( |
| 318 | &self, |
| 319 | handle: &OrgName, |
| 320 | name: &RepoName, |
| 321 | rev: &RefName, |
| 322 | path: &RepoPath, |
| 323 | ) -> impl Future<Output = Result<Option<Vec<TreeEntry>>, GitQueryError>> + Send; |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | fn read_blob( |
| 329 | &self, |
| 330 | handle: &OrgName, |
| 331 | name: &RepoName, |
| 332 | rev: &RefName, |
| 333 | path: &RepoPath, |
| 334 | max_bytes: u64, |
| 335 | ) -> impl Future<Output = Result<Option<Blob>, GitQueryError>> + Send; |
| 336 | |
| 337 | |
| 338 | fn log( |
| 339 | &self, |
| 340 | handle: &OrgName, |
| 341 | name: &RepoName, |
| 342 | rev: &RefName, |
| 343 | limit: usize, |
| 344 | ) -> impl Future<Output = Result<Vec<CommitSummary>, GitQueryError>> + Send; |
4ef3945feat: repository settings, README rendering, branch switcher, raw files7d | 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | fn list_refs( |
| 361 | &self, |
| 362 | handle: &OrgName, |
| 363 | name: &RepoName, |
| 364 | ) -> impl Future<Output = Result<Vec<GitRef>, GitQueryError>> + Send; |
dd5b600feat: the facts a repository page states about itself21h | 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | fn count_commits( |
| 373 | &self, |
| 374 | handle: &OrgName, |
| 375 | name: &RepoName, |
| 376 | rev: &RefName, |
| 377 | ) -> impl Future<Output = Result<u64, GitQueryError>> + Send; |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | fn latest_tag( |
| 389 | &self, |
| 390 | handle: &OrgName, |
| 391 | name: &RepoName, |
| 392 | ) -> impl Future<Output = Result<Option<TagSummary>, GitQueryError>> + Send; |
3bbcd9ffeat: a branch and a tag are rows, not just names20h | 393 | |
2268309feat: a commit is a page, and two revisions can be compared20h | 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | fn commit( |
| 405 | &self, |
| 406 | handle: &OrgName, |
| 407 | name: &RepoName, |
| 408 | rev: &RefName, |
| 409 | ) -> impl Future<Output = Result<Option<CommitDetail>, GitQueryError>> + Send; |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | fn diff( |
| 429 | &self, |
| 430 | handle: &OrgName, |
| 431 | name: &RepoName, |
| 432 | base: Option<&ObjectId>, |
| 433 | head: &ObjectId, |
| 434 | max_bytes: u64, |
| 435 | ) -> impl Future<Output = Result<RawDiff, GitQueryError>> + Send; |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | fn merge_base( |
| 444 | &self, |
| 445 | handle: &OrgName, |
| 446 | name: &RepoName, |
| 447 | base: &ObjectId, |
| 448 | head: &ObjectId, |
| 449 | ) -> impl Future<Output = Result<Option<ObjectId>, GitQueryError>> + Send; |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | fn log_between( |
| 460 | &self, |
| 461 | handle: &OrgName, |
| 462 | name: &RepoName, |
| 463 | base: Option<&ObjectId>, |
| 464 | head: &ObjectId, |
| 465 | limit: usize, |
| 466 | ) -> impl Future<Output = Result<Vec<CommitSummary>, GitQueryError>> + Send; |
| 467 | |
3bbcd9ffeat: a branch and a tag are rows, not just names20h | 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | fn branches( |
| 485 | &self, |
| 486 | handle: &OrgName, |
| 487 | name: &RepoName, |
| 488 | ) -> impl Future<Output = Result<Vec<BranchRow>, GitQueryError>> + Send; |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | fn tags( |
| 496 | &self, |
| 497 | handle: &OrgName, |
| 498 | name: &RepoName, |
| 499 | ) -> impl Future<Output = Result<Vec<TagRow>, GitQueryError>> + Send; |
1b7587dfeat: finding a string in a repository, and landing on the line20h | 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | fn grep( |
| 514 | &self, |
| 515 | handle: &OrgName, |
| 516 | name: &RepoName, |
| 517 | commit: &ObjectId, |
| 518 | query: &str, |
| 519 | limit: usize, |
| 520 | ) -> impl Future<Output = Result<Vec<GrepHit>, GitQueryError>> + Send; |
5727ed7feat: who last changed each line, as a thing the port can answer20h | 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | fn blame( |
| 537 | &self, |
| 538 | handle: &OrgName, |
| 539 | name: &RepoName, |
| 540 | rev: &RefName, |
| 541 | path: &RepoPath, |
| 542 | ) -> impl Future<Output = Result<Option<Blame>, GitQueryError>> + Send; |
dce0bf3feat: browse a repository's files and history8d | 543 | } |
2268309feat: a commit is a page, and two revisions can be compared20h | 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | #[derive(Debug, Clone, Default, PartialEq, Eq)] |
| 555 | pub struct RawDiff { |
| 556 | |
| 557 | |
| 558 | pub numstat: Vec<u8>, |
| 559 | |
| 560 | |
| 561 | pub patch: Vec<u8>, |
| 562 | |
| 563 | pub truncated: bool, |
| 564 | } |
dce0bf3feat: browse a repository's files and history8d | 565 | |
| 566 | #[derive(Debug)] |
c974d80feat: every read-side git process is bounded, and a timeout is not a fault20h | 567 | pub struct GitQueryError { |
| 568 | kind: GitQueryErrorKind, |
| 569 | source: Box<dyn std::error::Error + Send + Sync>, |
| 570 | } |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 578 | pub enum GitQueryErrorKind { |
| 579 | Failed, |
| 580 | TimedOut, |
| 581 | } |
dce0bf3feat: browse a repository's files and history8d | 582 | |
| 583 | impl GitQueryError { |
| 584 | pub fn new(error: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> Self { |
c974d80feat: every read-side git process is bounded, and a timeout is not a fault20h | 585 | Self { |
| 586 | kind: GitQueryErrorKind::Failed, |
| 587 | source: error.into(), |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | |
| 592 | pub fn timed_out(limit: std::time::Duration) -> Self { |
| 593 | Self { |
| 594 | kind: GitQueryErrorKind::TimedOut, |
| 595 | source: format!("git did not finish within {limit:?}").into(), |
| 596 | } |
| 597 | } |
| 598 | |
| 599 | pub fn kind(&self) -> GitQueryErrorKind { |
| 600 | self.kind |
| 601 | } |
| 602 | |
| 603 | pub fn is_timeout(&self) -> bool { |
| 604 | self.kind == GitQueryErrorKind::TimedOut |
dce0bf3feat: browse a repository's files and history8d | 605 | } |
| 606 | } |
| 607 | |
| 608 | impl std::fmt::Display for GitQueryError { |
| 609 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
c974d80feat: every read-side git process is bounded, and a timeout is not a fault20h | 610 | match self.kind { |
| 611 | GitQueryErrorKind::Failed => { |
| 612 | write!(f, "could not read the repository: {}", self.source) |
| 613 | } |
| 614 | GitQueryErrorKind::TimedOut => { |
| 615 | write!(f, "reading the repository took too long: {}", self.source) |
| 616 | } |
| 617 | } |
dce0bf3feat: browse a repository's files and history8d | 618 | } |
| 619 | } |
| 620 | |
| 621 | impl std::error::Error for GitQueryError { |
| 622 | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { |
c974d80feat: every read-side git process is bounded, and a timeout is not a fault20h | 623 | Some(&*self.source) |
dce0bf3feat: browse a repository's files and history8d | 624 | } |
| 625 | } |
b7a57dbfeat: a repository can be taken away as a file20h | 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 633 | pub enum ArchiveFormat { |
| 634 | TarGz, |
| 635 | Zip, |
| 636 | } |
| 637 | |
| 638 | impl ArchiveFormat { |
| 639 | |
| 640 | |
| 641 | pub fn as_str(self) -> &'static str { |
| 642 | match self { |
| 643 | Self::TarGz => "tar.gz", |
| 644 | Self::Zip => "zip", |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | pub fn content_type(self) -> &'static str { |
| 654 | match self { |
| 655 | Self::TarGz => "application/gzip", |
| 656 | Self::Zip => "application/zip", |
| 657 | } |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | |
| 662 | |
| 663 | impl std::str::FromStr for ArchiveFormat { |
| 664 | type Err = DomainError; |
| 665 | |
| 666 | fn from_str(value: &str) -> std::result::Result<Self, Self::Err> { |
| 667 | match value { |
| 668 | "tar.gz" => Ok(Self::TarGz), |
| 669 | "zip" => Ok(Self::Zip), |
| 670 | other => Err(DomainError::validation( |
| 671 | "format", |
| 672 | format!("unknown archive format {other:?}"), |
| 673 | )), |
| 674 | } |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 685 | pub struct ArchiveRequest { |
| 686 | pub handle: OrgName, |
| 687 | pub name: RepoName, |
| 688 | pub format: ArchiveFormat, |
| 689 | pub commit: ObjectId, |
| 690 | |
| 691 | |
| 692 | pub prefix: String, |
| 693 | } |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | pub trait GitArchive: Send + Sync { |
| 702 | fn archive( |
| 703 | &self, |
| 704 | request: ArchiveRequest, |
| 705 | ) -> impl Future<Output = Result<ByteStream, GitArchiveError>> + Send; |
| 706 | } |
| 707 | |
| 708 | |
| 709 | |
| 710 | |
| 711 | |
| 712 | #[derive(Debug)] |
| 713 | pub struct GitArchiveError(Box<dyn std::error::Error + Send + Sync>); |
| 714 | |
| 715 | impl GitArchiveError { |
| 716 | pub fn new(error: impl Into<Box<dyn std::error::Error + Send + Sync>>) -> Self { |
| 717 | Self(error.into()) |
| 718 | } |
| 719 | } |
| 720 | |
| 721 | impl std::fmt::Display for GitArchiveError { |
| 722 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 723 | write!(f, "could not archive the repository: {}", self.0) |
| 724 | } |
| 725 | } |
| 726 | |
| 727 | impl std::error::Error for GitArchiveError { |
| 728 | fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { |
| 729 | Some(&*self.0) |
| 730 | } |
| 731 | } |