Skip to content

Commit d57a883

Browse files
committed
'git pull' fix
native git command
1 parent 3bdd943 commit d57a883

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Application struct {
1313

1414
var App = Application{
1515
Name: "gitti",
16-
Version: "0.1.0",
16+
Version: "0.1.1",
1717
Author: "Philipp Speck <[email protected]>",
1818
Description: "Git HTTP Daemon",
1919
Explanation: "Git HTTP Daemon for managing multiple repositories via web hooks.",

app/git/ext/pull.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package ext
2+
3+
import (
4+
"github.com/typomedia/gitti/app/msg"
5+
"github.com/typomedia/gitti/app/str"
6+
"os/exec"
7+
)
8+
9+
func Pull(path string) string {
10+
cmd := exec.Command("git", "-C", path, "pull")
11+
12+
output, err := cmd.Output()
13+
msg.Check(err)
14+
15+
return str.Trim(output)
16+
}

app/hdlr/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"github.com/gorilla/mux"
66
"github.com/spf13/viper"
7-
"github.com/typomedia/gitti/app/git"
7+
"github.com/typomedia/gitti/app/git/ext"
88
"net/http"
99
)
1010

@@ -24,7 +24,7 @@ func Pull(w http.ResponseWriter, r *http.Request) {
2424
}
2525
}
2626

27-
pull := git.Pull(repo.Path)
27+
pull := ext.Pull(repo.Path)
2828

2929
fmt.Fprintf(w, "%v\n", pull)
3030

0 commit comments

Comments
 (0)