From 81a52442a129322acfa12bc22a75aa2652484f33 Mon Sep 17 00:00:00 2001
From: Antoine GIRARD <sapk@users.noreply.github.com>
Date: Sat, 14 Dec 2019 01:15:48 +0100
Subject: [PATCH] deps: update and fix chardet import (#9351)

---
 go.mod                                                     | 3 +--
 go.sum                                                     | 7 +++----
 modules/charset/charset.go                                 | 2 +-
 vendor/github.com/{gogits => gogs}/chardet/2022.go         | 0
 vendor/github.com/{gogits => gogs}/chardet/AUTHORS         | 0
 vendor/github.com/{gogits => gogs}/chardet/LICENSE         | 0
 vendor/github.com/{gogits => gogs}/chardet/README.md       | 2 +-
 vendor/github.com/{gogits => gogs}/chardet/detector.go     | 0
 vendor/github.com/gogs/chardet/go.mod                      | 1 +
 .../github.com/{gogits => gogs}/chardet/icu-license.html   | 0
 vendor/github.com/{gogits => gogs}/chardet/multi_byte.go   | 0
 vendor/github.com/{gogits => gogs}/chardet/recognizer.go   | 0
 vendor/github.com/{gogits => gogs}/chardet/single_byte.go  | 0
 vendor/github.com/{gogits => gogs}/chardet/unicode.go      | 0
 vendor/github.com/{gogits => gogs}/chardet/utf8.go         | 0
 vendor/modules.txt                                         | 4 ++--
 16 files changed, 9 insertions(+), 10 deletions(-)
 rename vendor/github.com/{gogits => gogs}/chardet/2022.go (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/AUTHORS (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/LICENSE (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/README.md (89%)
 rename vendor/github.com/{gogits => gogs}/chardet/detector.go (100%)
 create mode 100644 vendor/github.com/gogs/chardet/go.mod
 rename vendor/github.com/{gogits => gogs}/chardet/icu-license.html (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/multi_byte.go (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/recognizer.go (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/single_byte.go (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/unicode.go (100%)
 rename vendor/github.com/{gogits => gogs}/chardet/utf8.go (100%)

diff --git a/go.mod b/go.mod
index a68eddf0cf..68db5826c0 100644
--- a/go.mod
+++ b/go.mod
@@ -45,7 +45,7 @@ require (
 	github.com/go-sql-driver/mysql v1.4.1
 	github.com/go-swagger/go-swagger v0.20.1
 	github.com/gobwas/glob v0.2.3
-	github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561
+	github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
 	github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
 	github.com/google/go-github/v24 v24.0.1
 	github.com/gorilla/context v1.1.1
@@ -78,7 +78,6 @@ require (
 	github.com/quasoft/websspi v1.0.0
 	github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
 	github.com/russross/blackfriday/v2 v2.0.1
-	github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
 	github.com/satori/go.uuid v1.2.0
 	github.com/sergi/go-diff v1.0.0
 	github.com/shurcooL/httpfs v0.0.0-20190527155220-6a4d4a70508b // indirect
diff --git a/go.sum b/go.sum
index dd4ee71ac0..7df39f0eb3 100644
--- a/go.sum
+++ b/go.sum
@@ -235,11 +235,11 @@ github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
 github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
 github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
-github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561 h1:deE7ritpK04PgtpyVOS2TYcQEld9qLCD5b5EbVNOuLA=
-github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:YgYOrVn3Nj9Tq0EvjmFbphRytDj7JNRoWSStJZWDJTQ=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28 h1:gBeyun7mySAKWg7Fb0GOcv0upX9bdaZScs8QcRo8mEY=
+github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8=
 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
 github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
@@ -477,8 +477,6 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue
 github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
 github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
-github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
 github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
 github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
@@ -527,6 +525,7 @@ github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 h1:JNEGSiWg6D3lcBC
 github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2/go.mod h1:mjqs7N0Q6m5HpR7QfXVBZXZWSqTjQLeTujjA/xUp2uw=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
 github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
diff --git a/modules/charset/charset.go b/modules/charset/charset.go
index d3c5ac0b42..3d3d1664f9 100644
--- a/modules/charset/charset.go
+++ b/modules/charset/charset.go
@@ -12,7 +12,7 @@ import (
 	"code.gitea.io/gitea/modules/log"
 	"code.gitea.io/gitea/modules/setting"
 
-	"github.com/gogits/chardet"
+	"github.com/gogs/chardet"
 	"golang.org/x/net/html/charset"
 	"golang.org/x/text/transform"
 )
diff --git a/vendor/github.com/gogits/chardet/2022.go b/vendor/github.com/gogs/chardet/2022.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/2022.go
rename to vendor/github.com/gogs/chardet/2022.go
diff --git a/vendor/github.com/gogits/chardet/AUTHORS b/vendor/github.com/gogs/chardet/AUTHORS
similarity index 100%
rename from vendor/github.com/gogits/chardet/AUTHORS
rename to vendor/github.com/gogs/chardet/AUTHORS
diff --git a/vendor/github.com/gogits/chardet/LICENSE b/vendor/github.com/gogs/chardet/LICENSE
similarity index 100%
rename from vendor/github.com/gogits/chardet/LICENSE
rename to vendor/github.com/gogs/chardet/LICENSE
diff --git a/vendor/github.com/gogits/chardet/README.md b/vendor/github.com/gogs/chardet/README.md
similarity index 89%
rename from vendor/github.com/gogits/chardet/README.md
rename to vendor/github.com/gogs/chardet/README.md
index bbde23fb73..f5c7cc2087 100644
--- a/vendor/github.com/gogits/chardet/README.md
+++ b/vendor/github.com/gogs/chardet/README.md
@@ -9,4 +9,4 @@ The project was created by [saintfish](http://github.com/saintfish/chardet). In
 
 ## Documentation and Usage
 
-See [pkgdoc](http://godoc.org/github.com/gogits/chardet)
+See [pkgdoc](http://godoc.org/github.com/gogs/chardet)
diff --git a/vendor/github.com/gogits/chardet/detector.go b/vendor/github.com/gogs/chardet/detector.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/detector.go
rename to vendor/github.com/gogs/chardet/detector.go
diff --git a/vendor/github.com/gogs/chardet/go.mod b/vendor/github.com/gogs/chardet/go.mod
new file mode 100644
index 0000000000..d8653b8164
--- /dev/null
+++ b/vendor/github.com/gogs/chardet/go.mod
@@ -0,0 +1 @@
+module github.com/gogs/chardet
diff --git a/vendor/github.com/gogits/chardet/icu-license.html b/vendor/github.com/gogs/chardet/icu-license.html
similarity index 100%
rename from vendor/github.com/gogits/chardet/icu-license.html
rename to vendor/github.com/gogs/chardet/icu-license.html
diff --git a/vendor/github.com/gogits/chardet/multi_byte.go b/vendor/github.com/gogs/chardet/multi_byte.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/multi_byte.go
rename to vendor/github.com/gogs/chardet/multi_byte.go
diff --git a/vendor/github.com/gogits/chardet/recognizer.go b/vendor/github.com/gogs/chardet/recognizer.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/recognizer.go
rename to vendor/github.com/gogs/chardet/recognizer.go
diff --git a/vendor/github.com/gogits/chardet/single_byte.go b/vendor/github.com/gogs/chardet/single_byte.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/single_byte.go
rename to vendor/github.com/gogs/chardet/single_byte.go
diff --git a/vendor/github.com/gogits/chardet/unicode.go b/vendor/github.com/gogs/chardet/unicode.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/unicode.go
rename to vendor/github.com/gogs/chardet/unicode.go
diff --git a/vendor/github.com/gogits/chardet/utf8.go b/vendor/github.com/gogs/chardet/utf8.go
similarity index 100%
rename from vendor/github.com/gogits/chardet/utf8.go
rename to vendor/github.com/gogs/chardet/utf8.go
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 7673c5f172..d78427d3f0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -202,8 +202,8 @@ github.com/gobwas/glob/syntax/ast
 github.com/gobwas/glob/syntax/lexer
 github.com/gobwas/glob/util/runes
 github.com/gobwas/glob/util/strings
-# github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561
-github.com/gogits/chardet
+# github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
+github.com/gogs/chardet
 # github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
 github.com/gogs/cron
 # github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe