Skip to content

Commit ef003bd

Browse files
committed
close #237 lsremote should trimspace
1 parent 5bf837b commit ef003bd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

githandler/git.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ type Git struct {
1515
//LSRemote ...
1616
//Executes local git ls-remote with params
1717
func (os *Git) LSRemote(argv ...string) (string, error) {
18-
return os.Run("git", "ls-remote", argv...)
18+
output, err := os.Run("git", "ls-remote", argv...)
19+
if err != nil {
20+
return "", err
21+
}
22+
return strings.TrimSpace(output), nil
1923
}
2024

2125
//Branch ...

githandler/remote_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ var _ = Describe("Remote", func() {
1111

1212
Context("using github", func() {
1313
It("should return organisation and repository with https url", func() {
14-
var https = "https://github.com/Org/sOme--repo.git"
14+
var https = "https://github.com/Praqma/phlow-test-strategy.git"
1515
info := OrgAndRepo(https)
16-
Ω(info.Organisation).Should(Equal("Org"))
17-
Ω(info.Repository).Should(Equal("sOme--repo"))
16+
Ω(info.Organisation).Should(Equal("Praqma"))
17+
Ω(info.Repository).Should(Equal("phlow-test-strategy"))
1818
})
1919

2020
It("should return organisation and repository with ssh", func() {

0 commit comments

Comments
 (0)