Debian Codegraph @

debian/patches/test-fix-root-directory-resolution.patch

raw symbols SCIP
1 Description: Use parent dir as root rather than searching for .git.
2 Author: Lena Voytek <[email protected]>
3 Forwarded: not-needed
4 Last-Update: 2026-02-21
5 ---
6 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
7 --- a/test/test.go
8 +++ b/test/test.go
9 @@ -35,24 +35,15 @@
10 "os"
11 "path/filepath"
12 "runtime"
13 + "strings"
14 )
15
16 var Update = flag.Bool("update", false, "update .golden files")
17
18 func RootDir() string {
19 _, filename, _, _ := runtime.Caller(1)
20 - dir := filepath.Dir(filename)
21 - if fileExists(dir + "/.git") {
22 - return filepath.Clean(dir)
23 - }
24 - dir += "/"
25 - for i := 0; i < 10; i++ {
26 - dir = dir + "../"
27 - if fileExists(dir + ".git") {
28 - return filepath.Clean(dir)
29 - }
30 - }
31 - panic("Cannot find .git/")
32 + dir := filepath.Dir(filename) + "/"
33 + return dir[:strings.Index(dir, "/go-mysql/")+len("/go-mysql/")]
34 }
35
36 func fileExists(file string) bool {