diff --git a/src/screen/show_refs.rs b/src/screen/show_refs.rs index 4cd7483d59..a35b3cb646 100644 --- a/src/screen/show_refs.rs +++ b/src/screen/show_refs.rs @@ -38,9 +38,13 @@ fn create_remotes_sections<'a>(repo: &'a Repository) -> Res { diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 9cef1630d6..07fd228598 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -359,6 +359,21 @@ mod show_refs { run(&ctx.dir, &["git", "tag", "v1.0"]); snapshot!(ctx, "YjjjjjjbbY"); } + + #[test] + fn show_refs_with_remote_tracking_ref_without_remote() { + let ctx = setup_clone!(); + run( + &ctx.dir, + &[ + "git", + "update-ref", + "refs/remotes/conflict-upstream/main", + "HEAD", + ], + ); + snapshot!(ctx, "Y"); + } } #[test] diff --git a/src/tests/snapshots/gitu__tests__show_refs__show_refs_with_remote_tracking_ref_without_remote.snap b/src/tests/snapshots/gitu__tests__show_refs__show_refs_with_remote_tracking_ref_without_remote.snap new file mode 100644 index 0000000000..6804e9449b --- /dev/null +++ b/src/tests/snapshots/gitu__tests__show_refs__show_refs_with_remote_tracking_ref_without_remote.snap @@ -0,0 +1,25 @@ +--- +source: src/tests/mod.rs +expression: ctx.redact_buffer() +--- +▌Branches | +▌* main | + | + Remote origin | + origin/HEAD | + origin/main | + | + | + | + | + | + | + | + | + | + | + | + | + | + | +styles_hash: 23e139cddc801205