Skip to content

Commit ca91894

Browse files
jai-deepsourcemohi7solanki
authored andcommitted
Remove newline from HEAD commit OID and update API endpoint
Signed-off-by: Jai <jai@deepsource.io>
1 parent 22d60d1 commit ca91894

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

git.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bytes"
55
"os/exec"
6+
"strings"
67
)
78

89
// gitGetHead accepts a git directory and returns head commit OID / error
@@ -24,7 +25,8 @@ func gitGetHead(workspaceDir string) (string, error) {
2425
return headOID, err
2526
}
2627

27-
headOID = outStr
28+
// Trim newline suffix from Commit OID
29+
headOID = strings.TrimSuffix(outStr, "\n")
2830

2931
return headOID, nil
3032
}

init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ func main() {
177177
}
178178

179179
queryResponseBody, err := makeQuery(
180-
dsnProtocol+"://"+dsnHost+"/graphql",
180+
dsnProtocol+"://"+dsnHost+"/cli/graphql/",
181181
queryBodyBytes,
182182
"application/json",
183183
)
184184
if err != nil {
185-
fmt.Println("DeepSource | Error | Reporting query failed: %v", err)
185+
fmt.Println("DeepSource | Error | Reporting query failed: ", err)
186186
os.Exit(0)
187187
}
188188

0 commit comments

Comments
 (0)