diff options
author | Tim Oram <dev@mitmaro.ca> | 2024-06-26 22:27:58 -0230 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2024-06-26 21:18:40 -0400 |
commit | 30c7199875f1156be214d28da637f538010ecc1c (patch) | |
tree | c264543d3e9ebf0bb0e81dc8970a2c67c6a81f77 | |
parent | 2d458aa97cb9b2ba9cc59a5f11b6ba7a9c931f5b (diff) |
Fix reversed file names reversed in show commit2.4.1
The source and destination paths in the show commit summary and diff
views were reversed from the correct order. This ensures the correct
order of these file paths.
-rw-r--r-- | CHANGELOG.md | 9 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/modules/show_commit/tests.rs | 12 | ||||
-rw-r--r-- | src/modules/show_commit/util.rs | 8 |
6 files changed, 19 insertions, 16 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 865168e..aba8dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). +## [2.4.1] - 2024-06-26 +### Fixed +- Renamed and copied file order reversed in show commit view ([#926](https://github.com/MitMaro/git-interactive-rebase-tool/pull/926)) + ## [2.4.0] - 2024-06-13 ### Added -- Add support for `NO_COLOR` environment variable ([#896](https://github.com/MitMaro/git-interactive-rebase-tool/pull/896)) +- Add support for `NO_COLOR` environment variable ([#896](https://github.com/MitMaro/git-interactive-rebase-tool/pull/896)) - Post modified line exec command ([#888](https://github.com/MitMaro/git-interactive-rebase-tool/pull/890)) ### Changed @@ -184,7 +188,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - Initial project release -[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.0...HEAD +[Unreleased]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.1...HEAD +[2.4.1]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.4.0...2.4.1 [2.4.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.3.0...2.4.0 [2.3.0]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.2.1...2.3.0 [2.2.1]: https://github.com/MitMaro/git-interactive-rebase-tool/compare/2.2.0...2.2.1 @@ -319,7 +319,7 @@ dependencies = [ [[package]] name = "git-interactive-rebase-tool" -version = "2.4.0" +version = "2.4.1" dependencies = [ "anyhow", "bitflags 2.5.0", @@ -1,6 +1,6 @@ [package] name = "git-interactive-rebase-tool" -version = "2.4.0" +version = "2.4.1" authors = ["Tim Oram <dev@mitmaro.ca>"] license = "GPL-3.0-or-later" description = "Full feature terminal based sequence editor for git interactive rebase." @@ -9,8 +9,6 @@ Native cross-platform full feature terminal based [sequence editor][git-sequence [![Git Interactive Rebase Tool](/docs/assets/images/girt-demo.gif?raw=true)](https://youtu.be/q3tzb-gQC0w) -**This is the documentation for the development build. For the current stable release, please use the [2.4.x documentation](https://github.com/MitMaro/git-interactive-rebase-tool/tree/2.4.0/README.md).** - ## Table of Contents * [Features](./README.md#features) diff --git a/src/modules/show_commit/tests.rs b/src/modules/show_commit/tests.rs index 6d0c1f1..8e86b5d 100644 --- a/src/modules/show_commit/tests.rs +++ b/src/modules/show_commit/tests.rs @@ -386,10 +386,10 @@ fn render_overview_with_file_stats() { test_context.build_view_data(&mut module), "{IndicatorColor}0{Normal} files with {DiffAddColor}0{Normal} insertions and \ {DiffRemoveColor}0{Normal} deletions", - "{DiffChangeColor} renamed: {DiffRemoveColor}file.1b{Normal} → {DiffAddColor}file.1a", + "{DiffChangeColor} renamed: {DiffRemoveColor}file.1a{Normal} → {DiffAddColor}file.1b", "{DiffAddColor} added: file.2a", "{DiffRemoveColor} deleted: file.3a", - "{DiffAddColor} copied: {Normal}file.4b → {DiffAddColor}file.4a", + "{DiffAddColor} copied: {Normal}file.4a → {DiffAddColor}file.4b", "{DiffChangeColor}modified: file.5a", "{DiffChangeColor} changed: file.6a", "{Normal} unknown: file.7a" @@ -455,10 +455,10 @@ fn render_overview_with_file_stats_compact() { Skip 2, test_context.build_view_data(&mut module), "{IndicatorColor}0{Normal} / {DiffAddColor}0{Normal} / {DiffRemoveColor}0", - "{DiffChangeColor}R {DiffRemoveColor}file.1b{Normal}→{DiffAddColor}file.1a", + "{DiffChangeColor}R {DiffRemoveColor}file.1a{Normal}→{DiffAddColor}file.1b", "{DiffAddColor}A file.2a", "{DiffRemoveColor}D file.3a", - "{DiffAddColor}C {Normal}file.4b→{DiffAddColor}file.4a", + "{DiffAddColor}C {Normal}file.4a→{DiffAddColor}file.4b", "{DiffChangeColor}M file.5a", "{DiffChangeColor}T file.6a", "{Normal}X file.7a" @@ -735,13 +735,13 @@ fn render_diff_basic_file_stats() { {DiffRemoveColor}0{Normal} deletions", "{BODY}", "{Normal}{Pad(―)}", - "{DiffChangeColor} renamed: {DiffRemoveColor}file.1b{Normal} → {DiffAddColor}file.1a", + "{DiffChangeColor} renamed: {DiffRemoveColor}file.1a{Normal} → {DiffAddColor}file.1b", "{Normal}{Pad(―)}", "{DiffAddColor} added: file.2a", "{Normal}{Pad(―)}", "{DiffRemoveColor} deleted: file.3a", "{Normal}{Pad(―)}", - "{DiffAddColor} copied: {Normal}file.4b → {DiffAddColor}file.4a", + "{DiffAddColor} copied: {Normal}file.4a → {DiffAddColor}file.4b", "{Normal}{Pad(―)}", "{DiffChangeColor}modified: file.5a", "{Normal}{Pad(―)}", diff --git a/src/modules/show_commit/util.rs b/src/modules/show_commit/util.rs index ce75523..9ee897e 100644 --- a/src/modules/show_commit/util.rs +++ b/src/modules/show_commit/util.rs @@ -84,17 +84,17 @@ pub(super) fn get_stat_item_segments( Status::Copied => { vec![ LineSegment::new_with_color(status_name.as_str(), color), - LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::Normal), + LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::Normal), LineSegment::new(to_file_indicator), - LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor), + LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor), ] }, Status::Renamed => { vec![ LineSegment::new_with_color(status_name.as_str(), color), - LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffRemoveColor), + LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffRemoveColor), LineSegment::new(to_file_indicator), - LineSegment::new_with_color(from_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor), + LineSegment::new_with_color(to_name.to_str().unwrap_or("invalid"), DisplayColor::DiffAddColor), ] }, _ => { |