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

numtide / treefmt / 23309185459

19 Mar 2026 05:55PM UTC coverage: 39.742%. First build
23309185459

Pull #678

github

brianmcgee
fix: jujutsu test

Latest jujutsu creates a bit more files than before.

Signed-off-by: Brian McGee <brian@bmcgee.ie>
Pull Request #678: Some fixes and updates

56 of 64 new or added lines in 10 files covered. (87.5%)

802 of 2018 relevant lines covered (39.74%)

17.9 hits per line

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

0.0
/git/git.go
1
package git
2

3
import (
4
        "context"
5
        "errors"
6
        "fmt"
7
        "os/exec"
8
        "strings"
9
)
10

11
const TreeRootCmd = "git rev-parse --show-toplevel"
12

13
func IsInsideWorktree(path string) (bool, error) {
×
14
        // check if the root is a git repository
×
NEW
15
        cmd := exec.CommandContext(context.Background(), "git", "rev-parse", "--is-inside-work-tree")
×
16
        cmd.Dir = path
×
17

×
18
        out, err := cmd.Output()
×
19
        if err != nil {
×
20
                var exitErr *exec.ExitError
×
21
                if errors.As(err, &exitErr) && strings.Contains(string(exitErr.Stderr), "not a git repository") {
×
22
                        return false, nil
×
23
                }
×
24

25
                return false, fmt.Errorf("failed to check if %s is a git repository: %w", path, err)
×
26
        }
27

28
        if strings.Trim(string(out), "\n") != "true" {
×
29
                // not a git repo
×
30
                return false, nil
×
31
        }
×
32

33
        // is a git repo
34
        return true, nil
×
35
}
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