MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / github_commit_all

Function github_commit_all

crates/opencode-cli/src/main.rs:4950–4974  ·  view source on GitHub ↗
(
    summary: &str,
    actor: Option<&str>,
    include_coauthor: bool,
)

Source from the content-addressed store, hash-verified

4948}
4949
4950fn github_commit_all(
4951 summary: &str,
4952 actor: Option<&str>,
4953 include_coauthor: bool,
4954) -> anyhow::Result<()> {
4955 let title = truncate_text(summary.trim(), 72);
4956 let mut message = if title.trim().is_empty() {
4957 "Automated update from GitHub run".to_string()
4958 } else {
4959 title
4960 };
4961 if include_coauthor {
4962 if let Some(actor) = actor {
4963 if !actor.trim().is_empty() {
4964 message.push_str(&format!(
4965 "\n\nCo-authored-by: {} <{}@users.noreply.github.com>",
4966 actor, actor
4967 ));
4968 }
4969 }
4970 }
4971 git_run(&["add", "."])?;
4972 git_run(&["commit", "-m", &message])?;
4973 Ok(())
4974}
4975
4976fn github_push_new_branch(branch: &str) -> anyhow::Result<()> {
4977 git_run(&["push", "-u", "origin", branch])

Callers 1

handle_github_commandFunction · 0.85

Calls 3

git_runFunction · 0.85
is_emptyMethod · 0.80
truncate_textFunction · 0.70

Tested by

no test coverage detected