-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
template: add method mine() to commit type
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,35 @@ fn test_log_author_timestamp_local() { | |
"###); | ||
} | ||
|
||
#[test] | ||
fn test_mine_is_true_when_author_is_user() { | ||
let test_env = TestEnvironment::default(); | ||
test_env.jj_cmd_ok(test_env.env_root(), &["init", "repo", "--git"]); | ||
let repo_path = test_env.env_root().join("repo"); | ||
test_env.jj_cmd_ok( | ||
&repo_path, | ||
&[ | ||
"--config-toml=user.email='[email protected]'", | ||
"--config-toml=user.name='John Doe'", | ||
"new", | ||
], | ||
); | ||
|
||
let stdout = test_env.jj_cmd_success( | ||
&repo_path, | ||
&[ | ||
"log", | ||
"-T", | ||
r#"coalesce(if(mine, "mine"), author.email(), email_placeholder)"#, | ||
], | ||
); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ [email protected] | ||
◉ mine | ||
◉ (no email set) | ||
"###); | ||
} | ||
|
||
#[test] | ||
fn test_log_default() { | ||
let test_env = TestEnvironment::default(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters