Prechádzať zdrojové kódy

[GinR] Use G-Node git-module

cgars 7 rokov pred
rodič
commit
8c9747e7b2

+ 1 - 1
.gopmfile

@@ -19,7 +19,7 @@ github.com/go-xorm/core = commit:7daacb2
 github.com/go-xorm/xorm = commit:19f6dfc
 github.com/gogits/chardet = commit:2404f77
 github.com/gogits/cron = commit:2fc07a4
-github.com/gogits/git-module = commit:1b9552b
+github.com/G-Node/git-module = commit:1b9552b
 github.com/gogits/go-gogs-client = commit:264a3d5
 github.com/gogits/go-libravatar = commit:cd1abbd
 github.com/issue9/identicon = commit:d36b545

+ 1 - 1
cmd/hook.go

@@ -18,7 +18,7 @@ import (
 	"github.com/urfave/cli"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/httplib"

+ 2 - 0
docker/build.sh

@@ -11,6 +11,8 @@ export GO15VENDOREXPERIMENT=1
 go get golang.org/x/crypto/bcrypt
 go get github.com/jteeuwen/go-bindata
 go get github.com/G-Node/gin-doi/src
+go get github.com/G-Node/git-module
+
 go get gopkg.in/yaml.v2
 
 cd ${GOPATH}/src/github.com/jteeuwen/go-bindata/go-bindata

+ 1 - 1
models/action.go

@@ -17,7 +17,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
models/git_diff.go

@@ -15,7 +15,7 @@ import (
 	"golang.org/x/net/html/charset"
 	"golang.org/x/text/transform"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/pkg/tool"
 	"github.com/G-Node/gogs/pkg/setting"

+ 1 - 1
models/git_diff_test.go

@@ -8,7 +8,7 @@ import (
 	"html/template"
 	"testing"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	dmp "github.com/sergi/go-diff/diffmatchpatch"
 )
 

+ 1 - 1
models/migrations/v16.go

@@ -12,7 +12,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/pkg/setting"
 )

+ 1 - 1
models/mirror.go

@@ -15,7 +15,7 @@ import (
 	log "gopkg.in/clog.v1"
 	"gopkg.in/ini.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models/errors"
 	"github.com/G-Node/gogs/pkg/process"

+ 1 - 1
models/pull.go

@@ -15,7 +15,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
models/release.go

@@ -13,7 +13,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
models/repo.go

@@ -23,7 +23,7 @@ import (
 	log "gopkg.in/clog.v1"
 	"gopkg.in/ini.v1"
 
-	git "github.com/gogits/git-module"
+	git "github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
models/repo_branch.go

@@ -9,7 +9,7 @@ import (
 	"strings"
 
 	"github.com/Unknwon/com"
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/pkg/tool"
 )

+ 1 - 1
models/repo_editor.go

@@ -19,7 +19,7 @@ import (
 	gouuid "github.com/satori/go.uuid"
 	log "gopkg.in/clog.v1"
 
-	git "github.com/gogits/git-module"
+	git "github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/pkg/process"
 	"github.com/G-Node/gogs/pkg/setting"

+ 1 - 1
models/update.go

@@ -10,7 +10,7 @@ import (
 	"os/exec"
 	"strings"
 
-	git "github.com/gogits/git-module"
+	git "github.com/G-Node/git-module"
 )
 
 // CommitToPushCommit transforms a git.Commit to PushCommit type.

+ 1 - 1
models/user.go

@@ -26,7 +26,7 @@ import (
 	"golang.org/x/crypto/pbkdf2"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
models/webhook_discord.go

@@ -10,7 +10,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/pkg/setting"

+ 1 - 1
models/webhook_slack.go

@@ -9,7 +9,7 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/pkg/setting"

+ 1 - 1
models/wiki.go

@@ -15,7 +15,7 @@ import (
 
 	"github.com/Unknwon/com"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/pkg/setting"
 	"github.com/G-Node/gogs/pkg/sync"

+ 1 - 1
pkg/context/repo.go

@@ -12,7 +12,7 @@ import (
 	"gopkg.in/editorconfig/editorconfig-core-go.v1"
 	"gopkg.in/macaron.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/models/errors"

+ 7 - 0
public/js/gogs.js

@@ -509,6 +509,13 @@ function initRepository() {
     if ($('.repository.compare.pull').length > 0) {
         initFilterSearchDropdown('.choose.branch .dropdown');
     }
+
+	if ($('#download-repo-button')){
+			$('#download-repo-button').click(function () {
+				$('#download_modal')
+					.modal('show');
+			});
+		};
 }
 
 function initWikiForm() {

+ 1 - 1
routes/api/v1/convert/convert.go

@@ -9,7 +9,7 @@ import (
 
 	"github.com/Unknwon/com"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models"

+ 1 - 1
routes/api/v1/repo/file.go

@@ -5,7 +5,7 @@
 package repo
 
 import (
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"

+ 1 - 1
routes/install.go

@@ -17,7 +17,7 @@ import (
 	"gopkg.in/ini.v1"
 	"gopkg.in/macaron.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"

+ 1 - 1
routes/repo/branch.go

@@ -9,7 +9,7 @@ import (
 
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"

+ 1 - 1
routes/repo/commit.go

@@ -8,7 +8,7 @@ import (
 	"container/list"
 	"path"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"

+ 1 - 1
routes/repo/download.go

@@ -8,7 +8,7 @@ import (
 	"io"
 	"path"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"bufio"
 	"github.com/G-Node/go-annex"

+ 1 - 1
routes/repo/editor.go

@@ -13,7 +13,7 @@ import (
 
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"
 	"github.com/G-Node/gogs/pkg/form"

+ 1 - 1
routes/repo/pull.go

@@ -12,7 +12,7 @@ import (
 	"github.com/Unknwon/com"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/models/errors"

+ 6 - 1
routes/repo/repo.go

@@ -13,7 +13,7 @@ import (
 	"github.com/Unknwon/com"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/models/errors"
@@ -273,6 +273,10 @@ func Download(c *context.Context) {
 	)
 
 	switch {
+	case strings.HasSuffix(uri, ".gin.zip"):
+		ext = ".gin.zip"
+		archivePath = path.Join(c.Repo.GitRepo.Path, "archives/gin")
+		archiveType = git.GIN
 	case strings.HasSuffix(uri, ".zip"):
 		ext = ".zip"
 		archivePath = path.Join(c.Repo.GitRepo.Path, "archives/zip")
@@ -281,6 +285,7 @@ func Download(c *context.Context) {
 		ext = ".tar.gz"
 		archivePath = path.Join(c.Repo.GitRepo.Path, "archives/targz")
 		archiveType = git.TARGZ
+
 	default:
 		log.Trace("Unknown format: %s", uri)
 		c.Error(404)

+ 1 - 1
routes/repo/setting.go

@@ -11,7 +11,7 @@ import (
 
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/models/errors"

+ 1 - 1
routes/repo/view.go

@@ -15,7 +15,7 @@ import (
 	"github.com/Unknwon/paginater"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"bufio"
 	"io"

+ 1 - 1
routes/repo/webhook.go

@@ -11,7 +11,7 @@ import (
 
 	"github.com/Unknwon/com"
 
-	git "github.com/gogits/git-module"
+	git "github.com/G-Node/git-module"
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/G-Node/gogs/models"

+ 1 - 1
routes/repo/wiki.go

@@ -9,7 +9,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/gogits/git-module"
+	"github.com/G-Node/git-module"
 
 	"github.com/G-Node/gogs/models"
 	"github.com/G-Node/gogs/pkg/context"