From df91ec02003d05f2891225ef223db624955f0eed Mon Sep 17 00:00:00 2001 From: xvchris Date: Thu, 5 Mar 2026 00:06:33 +0800 Subject: [PATCH 1/3] fix: guard rename/update_url actions against empty remote list The rename_remote() and update_remote_url() event handlers in RemoteListPopup did not check valid_selection() before indexing into self.remote_names, causing a panic (index out of bounds) when no remotes are configured. The delete_remote() handler already had this guard. This commit adds the same valid_selection() check to the other two handlers for consistency. Fixes #2868 Fixes #2869 --- src/popups/remotelist.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/popups/remotelist.rs b/src/popups/remotelist.rs index 7f14f77dd2..c09986aef3 100644 --- a/src/popups/remotelist.rs +++ b/src/popups/remotelist.rs @@ -146,12 +146,14 @@ impl Component for RemoteListPopup { } else if key_match( e, self.key_config.keys.update_remote_name, - ) { + ) && self.valid_selection() + { self.rename_remote(); } else if key_match( e, self.key_config.keys.update_remote_url, - ) { + ) && self.valid_selection() + { self.update_remote_url(); } } From 233940fd46b16a9aa1fc0222a8282832b6f957ee Mon Sep 17 00:00:00 2001 From: xvchris Date: Fri, 6 Mar 2026 11:46:57 +0800 Subject: [PATCH 2/3] chore: add changelog entry and sort Cargo.toml dependencies --- CHANGELOG.md | 3 +++ asyncgit/Cargo.toml | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d86b65a2..f9ccb91573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * rust msrv bumped to `1.88` +### Fixed +* fix panic when renaming or updating remote URL with no remotes configured [[@xvchris](https://github.com/xvchris)] ([#2868](https://github.com/gitui-org/gitui/issues/2868)) + ## [0.28.0] - 2025-12-14 **discard changes on checkout** diff --git a/asyncgit/Cargo.toml b/asyncgit/Cargo.toml index ff9fb355b4..ca6d7b088d 100644 --- a/asyncgit/Cargo.toml +++ b/asyncgit/Cargo.toml @@ -24,12 +24,7 @@ easy-cast = "0.5" fuzzy-matcher = "0.3" git2 = "0.20" git2-hooks = { path = "../git2-hooks", version = ">=0.6" } -gix = { version = "0.78.0", default-features = false, features = [ - "max-performance", - "revision", - "mailmap", - "status", -] } +gix = { version = "0.78.0", default-features = false, features = ["max-performance", "revision", "mailmap", "status"] } log = "0.4" # git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]} # git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]} From 14755a89ad4bd330b834d89c8fff68959359a259 Mon Sep 17 00:00:00 2001 From: xvchris Date: Fri, 6 Mar 2026 16:40:57 +0800 Subject: [PATCH 3/3] revert: restore original Cargo.toml formatting --- asyncgit/Cargo.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/asyncgit/Cargo.toml b/asyncgit/Cargo.toml index ca6d7b088d..ff9fb355b4 100644 --- a/asyncgit/Cargo.toml +++ b/asyncgit/Cargo.toml @@ -24,7 +24,12 @@ easy-cast = "0.5" fuzzy-matcher = "0.3" git2 = "0.20" git2-hooks = { path = "../git2-hooks", version = ">=0.6" } -gix = { version = "0.78.0", default-features = false, features = ["max-performance", "revision", "mailmap", "status"] } +gix = { version = "0.78.0", default-features = false, features = [ + "max-performance", + "revision", + "mailmap", + "status", +] } log = "0.4" # git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]} # git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]}