Browse Source

Fixed ineffectual assignments (#7555)

Don't assign values we never use.
for-closed-social
Christian Muehlhaeuser 5 years ago
committed by Lunny Xiao
parent
commit
b0cd3b8ab9
2 changed files with 1 additions and 2 deletions
  1. +1
    -1
      models/git_diff.go
  2. +0
    -1
      routers/user/setting/security_twofa.go

+ 1
- 1
models/git_diff.go View File

@ -543,7 +543,7 @@ func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*D
// Get new file. // Get new file.
if strings.HasPrefix(line, cmdDiffHead) { if strings.HasPrefix(line, cmdDiffHead) {
middle := -1
var middle int
// Note: In case file name is surrounded by double quotes (it happens only in git-shell). // Note: In case file name is surrounded by double quotes (it happens only in git-shell).
// e.g. diff --git "a/xxx" "b/xxx" // e.g. diff --git "a/xxx" "b/xxx"

+ 0
- 1
routers/user/setting/security_twofa.go View File

@ -81,7 +81,6 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool {
// Filter unsafe character ':' in issuer // Filter unsafe character ':' in issuer
issuer := strings.Replace(setting.AppName+" ("+setting.Domain+")", ":", "", -1) issuer := strings.Replace(setting.AppName+" ("+setting.Domain+")", ":", "", -1)
if otpKey == nil { if otpKey == nil {
err = nil // clear the error, in case the URL was invalid
otpKey, err = totp.Generate(totp.GenerateOpts{ otpKey, err = totp.Generate(totp.GenerateOpts{
SecretSize: 40, SecretSize: 40,
Issuer: issuer, Issuer: issuer,

Loading…
Cancel
Save