Skip to content

Commit d14b1e8

Browse files
committed
git fsck
1 parent 05d41d5 commit d14b1e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package git
77
import (
88
"fmt"
99
"strings"
10+
"time"
1011
)
1112

1213
var (
@@ -54,3 +55,9 @@ func Version() (string, error) {
5455
func init() {
5556
Version()
5657
}
58+
59+
// Fsck verifies the connectivity and validity of the objects in the database
60+
func Fsck(repoPath string, timeout time.Duration, args ...string) error {
61+
_, err := NewCommand("fsck").AddArguments(args...).RunInDirTimeout(timeout, repoPath)
62+
return err
63+
}

0 commit comments

Comments
 (0)