MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_push_branch_flag

Function test_push_branch_flag

atomic-cli/src/commands/git/push.rs:1028–1043  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1026
1027 #[test]
1028 fn test_push_branch_flag() {
1029 let push = Push::try_parse_from(["push", "--branch", "pr-42"])
1030 .map_err(|e| e.to_string())
1031 .unwrap();
1032 assert_eq!(push.branch.as_deref(), Some("pr-42"));
1033
1034 let push = Push::try_parse_from(["push", "-b", "pr-42"])
1035 .map_err(|e| e.to_string())
1036 .unwrap();
1037 assert_eq!(push.branch.as_deref(), Some("pr-42"));
1038
1039 let push = Push::try_parse_from(["push"])
1040 .map_err(|e| e.to_string())
1041 .unwrap();
1042 assert!(push.branch.is_none());
1043 }
1044
1045 #[test]
1046 fn test_parse_trailer() {

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected