Skip to content

Commit

Permalink
templater: include pseudo @git targets in branches keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Jul 9, 2023
1 parent 2c3dd99 commit d58702c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
setting the `revsets.short-prefixes` config to a different revset.

* The last seen state of branches in the underlying git repo is now presented by
`jj branch list` as a remote called `git` (e.g. `main@git`). They can also be
referenced in revsets. Such branches exist in colocated repos or if you use
`jj git export`.
`jj branch list`/`jj log` as a remote called `git` (e.g. `main@git`). They can
also be referenced in revsets. Such branches exist in colocated repos or if
you use `jj git export`.

* The new `jj chmod` command allows setting or removing the executable bit on
paths. Unlike the POSIX `chmod`, it works on Windows, on conflicted files, and
Expand Down
5 changes: 3 additions & 2 deletions src/commit_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use jujutsu_lib::hex_util::to_reverse_hex;
use jujutsu_lib::id_prefix::IdPrefixContext;
use jujutsu_lib::op_store::{RefTarget, WorkspaceId};
use jujutsu_lib::repo::Repo;
use jujutsu_lib::rewrite;
use jujutsu_lib::{git, rewrite};
use once_cell::unsync::OnceCell;

use crate::formatter::Formatter;
Expand Down Expand Up @@ -352,7 +352,8 @@ impl RefNamesIndex {

fn build_branches_index(repo: &dyn Repo) -> RefNamesIndex {
let mut index = RefNamesIndex::default();
for (branch_name, branch_target) in repo.view().branches() {
let (all_branches, _) = git::build_unified_branches_map(repo.view());
for (branch_name, branch_target) in &all_branches {
let local_target = branch_target.local_target.as_ref();
let mut unsynced_remote_targets = branch_target
.remote_targets
Expand Down
2 changes: 1 addition & 1 deletion tests/test_branch_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn test_branch_forget_export() {
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-r=foo@git", "--no-graph"]);
insta::assert_snapshot!(stdout, @r###"
rlvkpnrzqnoo [email protected] 2001-02-03 04:05:08.000 +07:00 65b6b74e0897
rlvkpnrzqnoo [email protected] 2001-02-03 04:05:08.000 +07:00 foo@git 65b6b74e0897
(empty) (no description set)
"###);

Expand Down

0 comments on commit d58702c

Please sign in to comment.