@@ -460,7 +460,7 @@ $ ./build/samples/print_tags ext/libgit2
460
460
461
461
### Inspect Repository Objects (` git cat-file ` )
462
462
463
- Here's a ~ 125 line simplified implementation of ` git cat-file ` with ` cppgit2 `
463
+ Here's a simplified implementation of ` git cat-file ` with ` cppgit2 `
464
464
465
465
``` cpp
466
466
#include < cppgit2/repository.hpp>
@@ -482,11 +482,8 @@ void print_signature(const std::string &header, const signature &sig) {
482
482
auto hours = offset / 60;
483
483
auto minutes = offset % 60;
484
484
485
- std::cout << header << " "
486
- << sig.name() << " "
487
- << "<" << sig.email() << "> "
488
- << sig.time() << " "
489
- << sign;
485
+ std::cout << header << " " << sig.name() << " " << "<" << sig.email() << "> "
486
+ << sig.time() << " " << sign;
490
487
std::cout << std::setfill('0') << std::setw(2) << hours;
491
488
std::cout << std::setfill('0') << std::setw(2) << minutes << std::endl;
492
489
}
@@ -591,7 +588,7 @@ int main(int argc, char **argv) {
591
588
592
589
Running this sample on one of the `libgit2` commits yields the following:
593
590
594
- ```bash
591
+ ```
595
592
$ ./cat_file -p 01a8340662749943f3917505dc8ca65006495bec
596
593
tree 83d9bef2675178eeb3aa61d17e5c8b0f7b0ec1de
597
594
parent 76b49caf6a208e44d19c84caa6d42389f0de6194
@@ -608,9 +605,7 @@ Docker itself. Instead, this exception is thrown by gosu(1), which is a
608
605
Go-based utility to drop privileges and run by our entrypoint.
609
606
610
607
Fix the issue by dropping gosu(1) in favor of sudo(1).
611
- ```
612
608
613
- ``` bash
614
609
$ ./cat_file -p 83d9bef2675178eeb3aa61d17e5c8b0f7b0ec1de
615
610
100644 blob fd8430bc864cfcd5f10e5590f8a447e01b942bfe .HEADER
616
611
100644 blob 34c5e9234ec18c69a16828dbc9633a95f0253fe9 .editorconfig
@@ -637,9 +632,7 @@ $ ./cat_file -p 83d9bef2675178eeb3aa61d17e5c8b0f7b0ec1de
637
632
040000 tree 97afcc9b6e4ca91001aadf8a3414d043f22918cf script
638
633
040000 tree a08bd8a57d619b736ad2c300614b36ead8d0a333 src
639
634
040000 tree dcf5925f8bbda8062ef26ca427c5110868a7f041 tests
640
- ```
641
635
642
- ``` bash
643
636
$ ./cat_file -s 8765a97b5b120259dd59262865ce166f382c0f9e
644
637
11957
645
638
```
0 commit comments