File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525- tags not shown in commit details popup ([ #193 ] ( https://github.com/extrawurst/gitui/issues/193 ) )
2626- min size for relative popups on small terminals ([ #179 ] ( https://github.com/extrawurst/gitui/issues/179 ) )
2727- fix crash on resizing terminal to very small width ([ #198 ] ( https://github.com/extrawurst/gitui/issues/198 ) )
28+ - fix broken tags when using a different internal representation ([ #206 ] ( https://github.com/extrawurst/gitui/issues/206 ) )
2829
2930## [ 0.8.1] - 2020-07-07
3031
Original file line number Diff line number Diff line change @@ -23,13 +23,24 @@ pub fn get_tags(repo_path: &str) -> Result<Tags> {
2323
2424 let repo = repo ( repo_path) ?;
2525
26+ //TODO: use tag_foreach once its released
27+ // see https://github.com/rust-lang/git2-rs/pull/595
2628 for name in repo. tag_names ( None ) ?. iter ( ) {
2729 if let Some ( name) = name {
28- let obj = repo. revparse_single ( name) ?;
30+ let reference = repo. find_reference (
31+ format ! ( "refs/tags/{}" , name) . as_str ( ) ,
32+ ) ?;
33+ let reference = reference. resolve ( ) ?;
2934
30- if let Some ( tag) = obj. as_tag ( ) {
35+ let commit_id = if let Ok ( tag) = reference. peel_to_tag ( ) {
36+ Some ( tag. target_id ( ) )
37+ } else {
38+ reference. target ( )
39+ } ;
40+
41+ if let Some ( commit_id) = commit_id {
3142 let tag_name = String :: from ( name) ;
32- adder ( CommitId :: new ( tag . target_id ( ) ) , tag_name) ;
43+ adder ( CommitId :: new ( commit_id ) , tag_name) ;
3344 }
3445 }
3546 }
You can’t perform that action at this time.
0 commit comments