]> source.dussan.org Git - gitea.git/commitdiff
Fix #495 and cannot view repository by tag
authorUnknwon <joe2010xtmf@163.com>
Tue, 23 Sep 2014 17:06:25 +0000 (13:06 -0400)
committerUnknwon <joe2010xtmf@163.com>
Tue, 23 Sep 2014 17:06:25 +0000 (13:06 -0400)
cmd/web.go
gogs.go
modules/git/repo_tag.go
modules/middleware/repo.go
public/ng/css/ui.css
public/ng/less/ui/reset.less
templates/.VERSION

index a5ebf259eade054a9b94987fbd99c01404274d48..e2c929c1c3460ee8cb8b6cca20869dd54088ea71 100644 (file)
@@ -355,7 +355,7 @@ func runWeb(*cli.Context) {
                r.Get("/commit/:branchname", repo.Diff)
                r.Get("/commit/:branchname/*", repo.Diff)
                r.Get("/releases", repo.Releases)
-               r.Get("/archive/*.*", repo.Download)
+               r.Get("/archive/:branchname/*.*", repo.Download)
                r.Get("/compare/:before([a-z0-9]+)...:after([a-z0-9]+)", repo.CompareDiff)
        }, ignSignIn, middleware.RepoAssignment(true, true))
 
diff --git a/gogs.go b/gogs.go
index 8473304242ca2fa253b5e42bcebf9673cc2c0daa..0821dbc2202d53a3d66cbec4f680788aee6e0e49 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.4.0922 Beta"
+const APP_VER = "0.5.4.0923 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index 21818f3e6b8892b2e576526b4c2e86f48db6c177..dd31e4414fcdc19c611253f48f1459759d2fc688 100644 (file)
@@ -77,6 +77,7 @@ func (repo *Repository) getTag(id sha1) (*Tag, error) {
        }
 
        tag.Id = id
+       tag.Object = id
        tag.repo = repo
 
        repo.tagCache[id] = tag
index f17018ddf366ce5912cd45cc2b126a88970a6e65..7227e05de7866eb7295c48213a6e9484657998ff 100644 (file)
@@ -213,7 +213,11 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
                                                ctx.Handle(404, "RepoAssignment invalid tag", nil)
                                                return
                                        }
-                                       ctx.Repo.Commit, _ = ctx.Repo.Tag.Commit()
+                                       ctx.Repo.Commit, err = ctx.Repo.Tag.Commit()
+                                       if err != nil {
+                                               ctx.Handle(500, "RepoAssignment", fmt.Errorf("fail to get tag commit(%s): %v", refName, err))
+                                               return
+                                       }
                                        ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()
                                } else if len(refName) == 40 {
                                        ctx.Repo.IsCommit = true
@@ -226,7 +230,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
                                                return
                                        }
                                } else {
-                                       ctx.Handle(404, "RepoAssignment invalid repo", errors.New("branch or tag not exist"))
+                                       ctx.Handle(404, "RepoAssignment invalid repo", fmt.Errorf("branch or tag not exist: %s", refName))
                                        return
                                }
 
index f3f6eded79a075e08a77e8675ca17e8b683e777f..5dc3cc0408724042a639086fcb02d7dbbdd93124 100644 (file)
@@ -151,7 +151,8 @@ code,
 kbd,
 pre,
 samp {
-  font: 14px Consolas, "Liberation Mono", Menlo, Courier, monospace;
+  font-family: monospace, monospace;
+  font-size: 1em;
 }
 .text-left {
   text-align: left;
index 8ff45d694d9f23142f9c7a7f3de58ee5ef097395..0e7a50e40828c9c402d4277da91b669b48c309d0 100644 (file)
@@ -193,21 +193,19 @@ code,
 kbd,
 pre,
 samp {
-    font: 14px Consolas, "Liberation Mono", Menlo, Courier, monospace;
+    font-family: monospace, monospace;
+    font-size: 1em;
 }
 
 .text-left {
   text-align: left;
 }
-
 .text-right {
   text-align: right;
 }
-
 .text-center {
   text-align: center;
 }
-
 .list-no-style {
   list-style: none;
 }
index 8a713df0428fcb47ec6811ed2c6207599b818a6a..23f5f0fe591343661ae783bac2f02da597ed1fa3 100644 (file)
@@ -1 +1 @@
-0.5.4.0922 Beta
\ No newline at end of file
+0.5.4.0923 Beta
\ No newline at end of file