File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 44
44
- name : Run clippy
45
45
run : cargo clippy
46
46
47
- - name : Debug
48
- run : " cat .git/HEAD; git cat-file -p a802f89fc823c6c8cf2467c2b7908e1d78e8b755"
49
47
- name : Run onefetch
50
48
run : cargo run
51
49
Original file line number Diff line number Diff line change @@ -105,10 +105,15 @@ impl<'a> Repo<'a> {
105
105
106
106
let mut num_commits = 0 ;
107
107
while let Some ( commit_id) = commit_iter. next ( ) {
108
- let commit: git:: Commit = commit_id?
109
- . object ( )
110
- . expect ( "commit is still present/comes from cache" )
111
- . into_commit ( ) ;
108
+ let commit = match commit_id {
109
+ Ok ( commit_id) => commit_id
110
+ . object ( )
111
+ . expect ( "commit is still present/comes from cache" )
112
+ . into_commit ( ) ,
113
+ Err ( git:: traverse:: commit:: ancestors:: Error :: FindExisting { .. } ) => break , // assume a shallow clone
114
+ Err ( err) => return Err ( err. into ( ) ) ,
115
+ } ;
116
+
112
117
{
113
118
let commit = commit. decode ( ) ?;
114
119
if no_merges && commit. parents ( ) . take ( 2 ) . count ( ) > 1 {
You can’t perform that action at this time.
0 commit comments