Skip to content

Commit 1b8797e

Browse files
Keep up-to-date git push output lean
1 parent 5a149a7 commit 1b8797e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/cmds/git/git.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,9 +1151,10 @@ impl LineHandler for GitPushLineHandler {
11511151
if exit_code != 0 {
11521152
return None;
11531153
}
1154-
let summary = if self.up_to_date {
1155-
"ok (up-to-date)".to_string()
1156-
} else if let Some(dest) = &self.pushed_ref {
1154+
if self.up_to_date {
1155+
return None;
1156+
}
1157+
let summary = if let Some(dest) = &self.pushed_ref {
11571158
format!("ok {}", dest)
11581159
} else {
11591160
"ok".to_string()
@@ -2892,11 +2893,10 @@ To https://github.com/foo/bar.git
28922893
}
28932894

28942895
#[test]
2895-
fn test_push_filter_up_to_date_summary() {
2896+
fn test_push_filter_up_to_date_preserves_git_message() {
28962897
let input = "Everything up-to-date\n";
28972898
let result = run_push_filter(input, 0);
2898-
assert!(result.contains("Everything up-to-date"));
2899-
assert!(result.ends_with("ok (up-to-date)\n"), "got: {}", result);
2899+
assert_eq!(result, input);
29002900
}
29012901

29022902
#[test]

0 commit comments

Comments
 (0)