• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dcdpr / jp / 18002569568

25 Sep 2025 09:06AM UTC coverage: 43.653% (-0.007%) from 43.66%
18002569568

Pull #247

github

web-flow
Merge 90d0834e7 into 076131be6
Pull Request #247: chore(tools): Add `git` and `web` tools and simplified file modification

79 of 176 new or added lines in 13 files covered. (44.89%)

2 existing lines in 2 files now uncovered.

5430 of 12439 relevant lines covered (43.65%)

6.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/.config/jp/tools/src/git/commit.rs
1
use std::{path::PathBuf, process::Command};
2

3
use crate::Error;
4

NEW
5
pub(crate) async fn git_commit(
×
NEW
6
    root: PathBuf,
×
NEW
7
    message: String,
×
NEW
8
) -> std::result::Result<String, Error> {
×
NEW
9
    let output = Command::new("git")
×
NEW
10
        .args(["commit", "--quiet", "--signoff", "--message", &message])
×
NEW
11
        .current_dir(root)
×
NEW
12
        .output()?;
×
13

NEW
14
    let error = str::from_utf8(&output.stderr).unwrap_or_default();
×
NEW
15
    if error.contains("fatal: not a git repository") {
×
NEW
16
        return Err("Not a git repository.".into());
×
NEW
17
    }
×
18

NEW
19
    if !output.status.success() {
×
NEW
20
        return Err(format!(
×
NEW
21
            "Git command failed ({}): {}",
×
NEW
22
            output.status.code().unwrap_or_default(),
×
NEW
23
            error,
×
NEW
24
        )
×
NEW
25
        .into());
×
NEW
26
    }
×
27

NEW
28
    let out = String::from_utf8(output.stdout).unwrap_or_default();
×
29

NEW
30
    Ok(indoc::formatdoc! {"
×
NEW
31
        Commit successful:
×
NEW
32

×
NEW
33
        ```
×
NEW
34
        {out}
×
NEW
35
        ```
×
NEW
36
    "})
×
NEW
37
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc