File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
gitoxide-core/src/repository Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ mod refs_impl {
3
3
use anyhow:: bail;
4
4
use git_repository as git;
5
5
use git_repository:: protocol:: fetch;
6
+ use git_repository:: refspec:: match_group:: validate:: Fix ;
6
7
use git_repository:: refspec:: RefSpec ;
7
8
8
9
use crate :: OutputFormat ;
@@ -128,9 +129,25 @@ mod refs_impl {
128
129
} ?;
129
130
}
130
131
if !map. fixes . is_empty ( ) {
131
- writeln ! ( err, "Fixes and sanitizations" ) ?;
132
+ writeln ! (
133
+ err,
134
+ "The following destination refs were removed as they didn't start with 'ref/'"
135
+ ) ?;
136
+ map. fixes . sort_by_key ( |f| match f {
137
+ Fix :: MappingWithPartialDestinationRemoved { spec, .. } => * spec,
138
+ } ) ;
139
+ let mut prev_spec = None ;
132
140
for fix in & map. fixes {
133
- writeln ! ( err, "\t {fix:?}" ) ?;
141
+ match fix {
142
+ Fix :: MappingWithPartialDestinationRemoved { name, spec } => {
143
+ if prev_spec. map_or ( true , |prev_spec| prev_spec != spec) {
144
+ prev_spec = spec. into ( ) ;
145
+ spec. write_to ( & mut err) ?;
146
+ writeln ! ( err) ?;
147
+ }
148
+ writeln ! ( err, "\t {name}" ) ?;
149
+ }
150
+ }
134
151
}
135
152
}
136
153
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments