File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ pub mod write {
3636 ShallowUpdate :: Unshallow ( id) => shallow_commits. retain ( |oid| oid != id) ,
3737 }
3838 }
39+ if shallow_commits. is_empty ( ) {
40+ std:: fs:: remove_file ( file. resource_path ( ) ) ?;
41+ drop ( file) ;
42+ return Ok ( ( ) ) ;
43+ }
3944
4045 if shallow_commits. is_empty ( ) {
4146 if let Err ( err) = std:: fs:: remove_file ( file. resource_path ( ) ) {
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ mod blocking_io {
7272 !repo. is_shallow( ) ,
7373 "both methods agree - if there are no shallow commits, it shouldn't think the repo is shallow"
7474 ) ;
75+ assert ! (
76+ !repo. shallow_file( ) . exists( ) ,
77+ "when the repo is not shallow anymore, there is no need for a shallow file"
78+ ) ;
7579 assert ! (
7680 repo. head_id( ) ?. ancestors( ) . all( ) ?. count( ) > shallow_commit_count,
7781 "there are more commits now as the history is complete"
You can’t perform that action at this time.
0 commit comments