Skip to content

Commit bfb840a

Browse files
committed
add branch for non ci test condition
1 parent 692bda9 commit bfb840a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/git_changed_files_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ package tests
22

33
import (
44
"fmt"
5-
git "github.com/libgit2/git2go/v31"
6-
git2 "github.com/neel1996/gitconvex-server/git"
7-
"github.com/neel1996/gitconvex-server/graph/model"
85
"io/ioutil"
96
"os"
7+
"path"
108
"strings"
119
"testing"
10+
11+
git "github.com/libgit2/git2go/v31"
12+
git2 "github.com/neel1996/gitconvex-server/git"
13+
"github.com/neel1996/gitconvex-server/graph/model"
1214
)
1315

1416
func TestChangedFiles(t *testing.T) {
@@ -20,6 +22,9 @@ func TestChangedFiles(t *testing.T) {
2022
if currentEnv == "ci" {
2123
repoPath = "/home/runner/work/gitconvex-server/starfleet"
2224
r, _ = git.OpenRepository(repoPath)
25+
} else {
26+
cwd, _ := os.Getwd()
27+
r, _ = git.OpenRepository(path.Join(cwd, ".."))
2328
}
2429

2530
untrackedResult := "untracked.txt"

0 commit comments

Comments
 (0)