Browse Source

Add bundle download for repository (#14538)

* Add bundle download

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Fix fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Fix build tags

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Download specific commit

Signed-off-by: jolheiser <john.olheiser@gmail.com>
tags/v1.16.0-rc1
John Olheiser 2 years ago
parent
commit
648464b504
No account linked to committer's email address
83 changed files with 167 additions and 41 deletions
  1. 2
    1
      build.go
  2. 1
    0
      build/generate-bindata.go
  3. 1
    0
      build/generate-emoji.go
  4. 1
    0
      build/generate-gitignores.go
  5. 1
    0
      build/generate-licenses.go
  6. 1
    0
      build/gocovmerge.go
  7. 1
    0
      cmd/embedded.go
  8. 1
    0
      cmd/embedded_stub.go
  9. 3
    2
      modules/auth/pam/pam.go
  10. 3
    2
      modules/auth/pam/pam_stub.go
  11. 1
    0
      modules/auth/pam/pam_test.go
  12. 1
    0
      modules/git/blob_gogit.go
  13. 1
    0
      modules/git/blob_nogogit.go
  14. 1
    0
      modules/git/command_test.go
  15. 1
    0
      modules/git/commit_convert_gogit.go
  16. 1
    0
      modules/git/commit_info_gogit.go
  17. 1
    0
      modules/git/commit_info_nogogit.go
  18. 1
    0
      modules/git/last_commit_cache_gogit.go
  19. 1
    0
      modules/git/last_commit_cache_nogogit.go
  20. 1
    0
      modules/git/notes_gogit.go
  21. 1
    0
      modules/git/notes_nogogit.go
  22. 1
    0
      modules/git/parse_gogit.go
  23. 1
    0
      modules/git/parse_gogit_test.go
  24. 1
    0
      modules/git/parse_nogogit.go
  25. 1
    0
      modules/git/parse_nogogit_test.go
  26. 1
    0
      modules/git/pipeline/lfs.go
  27. 1
    0
      modules/git/pipeline/lfs_nogogit.go
  28. 31
    0
      modules/git/repo.go
  29. 4
    0
      modules/git/repo_archive.go
  30. 1
    0
      modules/git/repo_base_gogit.go
  31. 1
    0
      modules/git/repo_base_nogogit.go
  32. 1
    0
      modules/git/repo_blob_gogit.go
  33. 1
    0
      modules/git/repo_blob_nogogit.go
  34. 1
    0
      modules/git/repo_branch_gogit.go
  35. 1
    0
      modules/git/repo_branch_nogogit.go
  36. 1
    0
      modules/git/repo_commit_gogit.go
  37. 1
    0
      modules/git/repo_commit_nogogit.go
  38. 1
    0
      modules/git/repo_commitgraph_gogit.go
  39. 1
    0
      modules/git/repo_language_stats_gogit.go
  40. 1
    0
      modules/git/repo_language_stats_nogogit.go
  41. 1
    0
      modules/git/repo_ref_gogit.go
  42. 1
    0
      modules/git/repo_ref_nogogit.go
  43. 1
    0
      modules/git/repo_tag_gogit.go
  44. 1
    0
      modules/git/repo_tag_nogogit.go
  45. 1
    0
      modules/git/repo_tree_gogit.go
  46. 1
    0
      modules/git/repo_tree_nogogit.go
  47. 1
    0
      modules/git/sha1_gogit.go
  48. 1
    0
      modules/git/sha1_nogogit.go
  49. 1
    0
      modules/git/signature_gogit.go
  50. 1
    0
      modules/git/signature_nogogit.go
  51. 1
    0
      modules/git/tree_blob_gogit.go
  52. 1
    0
      modules/git/tree_blob_nogogit.go
  53. 1
    0
      modules/git/tree_entry_gogit.go
  54. 1
    0
      modules/git/tree_entry_nogogit.go
  55. 1
    0
      modules/git/tree_entry_test.go
  56. 1
    0
      modules/git/tree_gogit.go
  57. 1
    0
      modules/git/tree_nogogit.go
  58. 3
    2
      modules/graceful/manager_unix.go
  59. 3
    2
      modules/graceful/manager_windows.go
  60. 3
    2
      modules/graceful/net_unix.go
  61. 3
    2
      modules/graceful/net_windows.go
  62. 3
    2
      modules/graceful/restart_unix.go
  63. 1
    0
      modules/lfs/pointer_scanner_gogit.go
  64. 1
    0
      modules/lfs/pointer_scanner_nogogit.go
  65. 3
    2
      modules/options/dynamic.go
  66. 2
    1
      modules/options/options_bindata.go
  67. 3
    2
      modules/options/static.go
  68. 3
    2
      modules/public/dynamic.go
  69. 2
    1
      modules/public/public_bindata.go
  70. 3
    2
      modules/public/static.go
  71. 1
    0
      modules/setting/database_sqlite.go
  72. 1
    0
      modules/svg/discover_bindata.go
  73. 1
    0
      modules/svg/discover_nobindata.go
  74. 3
    2
      modules/templates/dynamic.go
  75. 3
    2
      modules/templates/static.go
  76. 2
    1
      modules/templates/templates_bindata.go
  77. 1
    0
      options/locale/locale_en-US.ini
  78. 3
    2
      routers/private/manager_unix.go
  79. 3
    2
      routers/private/manager_windows.go
  80. 18
    7
      services/archiver/archiver.go
  81. 1
    0
      services/auth/placeholder.go
  82. 1
    0
      templates/repo/home.tmpl
  83. 1
    0
      tools/fuzz.go

+ 2
- 1
build.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//+build vendor
//go:build vendor
// +build vendor


package main package main



+ 1
- 0
build/generate-bindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build ignore
// +build ignore // +build ignore


package main package main

+ 1
- 0
build/generate-emoji.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build ignore
// +build ignore // +build ignore


package main package main

+ 1
- 0
build/generate-gitignores.go View File

//go:build ignore
// +build ignore // +build ignore


package main package main

+ 1
- 0
build/generate-licenses.go View File

//go:build ignore
// +build ignore // +build ignore


package main package main

+ 1
- 0
build/gocovmerge.go View File

// gocovmerge takes the results from multiple `go test -coverprofile` runs and // gocovmerge takes the results from multiple `go test -coverprofile` runs and
// merges them into one profile // merges them into one profile


//go:build ignore
// +build ignore // +build ignore


package main package main

+ 1
- 0
cmd/embedded.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build bindata
// +build bindata // +build bindata


package cmd package cmd

+ 1
- 0
cmd/embedded_stub.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !bindata
// +build !bindata // +build !bindata


package cmd package cmd

+ 3
- 2
modules/auth/pam/pam.go View File

// +build pam

// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build pam
// +build pam

package pam package pam


import ( import (

+ 3
- 2
modules/auth/pam/pam_stub.go View File

// +build !pam

// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !pam
// +build !pam

package pam package pam


import ( import (

+ 1
- 0
modules/auth/pam/pam_test.go View File

//go:build pam
// +build pam // +build pam


// Copyright 2021 The Gitea Authors. All rights reserved. // Copyright 2021 The Gitea Authors. All rights reserved.

+ 1
- 0
modules/git/blob_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/blob_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/command_test.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build race
// +build race // +build race


package git package git

+ 1
- 0
modules/git/commit_convert_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/commit_info_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/commit_info_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/last_commit_cache_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/last_commit_cache_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/notes_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/notes_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/parse_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/parse_gogit_test.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/parse_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/parse_nogogit_test.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/pipeline/lfs.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package pipeline package pipeline

+ 1
- 0
modules/git/pipeline/lfs_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package pipeline package pipeline

+ 31
- 0
modules/git/repo.go View File

"net/url" "net/url"
"os" "os"
"path" "path"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
"time" "time"


return DivergeObject{ahead, behind}, nil return DivergeObject{ahead, behind}, nil
} }

// CreateBundle create bundle content to the target path
func (repo *Repository) CreateBundle(ctx context.Context, commit string, out io.Writer) error {
tmp, err := os.MkdirTemp(os.TempDir(), "gitea-bundle")
if err != nil {
return err
}
defer os.RemoveAll(tmp)

tmpFile := filepath.Join(tmp, "bundle")
args := []string{
"bundle",
"create",
tmpFile,
commit,
}
_, err = NewCommandContext(ctx, args...).RunInDir(repo.Path)
if err != nil {
return err
}

fi, err := os.Open(tmpFile)
if err != nil {
return err
}
defer fi.Close()

_, err = io.Copy(out, fi)
return err
}

+ 4
- 0
modules/git/repo_archive.go View File

ZIP ArchiveType = iota + 1 ZIP ArchiveType = iota + 1
// TARGZ tar gz archive type // TARGZ tar gz archive type
TARGZ TARGZ
// BUNDLE bundle archive type
BUNDLE
) )


// String converts an ArchiveType to string // String converts an ArchiveType to string
return "zip" return "zip"
case TARGZ: case TARGZ:
return "tar.gz" return "tar.gz"
case BUNDLE:
return "bundle"
} }
return "unknown" return "unknown"
} }

+ 1
- 0
modules/git/repo_base_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_base_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_blob_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_blob_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_branch_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_branch_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_commit_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_commit_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_commitgraph_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_language_stats_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_language_stats_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_ref_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_ref_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_tag_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_tag_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/repo_tree_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/repo_tree_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/sha1_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/sha1_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/signature_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/signature_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/tree_blob_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/tree_blob_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/tree_entry_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/tree_entry_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 1
- 0
modules/git/tree_entry_test.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/tree_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package git package git

+ 1
- 0
modules/git/tree_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package git package git

+ 3
- 2
modules/graceful/manager_unix.go View File

// +build !windows

// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !windows
// +build !windows

package graceful package graceful


import ( import (

+ 3
- 2
modules/graceful/manager_windows.go View File

// +build windows

// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler // This code is heavily inspired by the archived gofacebook/gracenet/net.go handler


//go:build windows
// +build windows

package graceful package graceful


import ( import (

+ 3
- 2
modules/graceful/net_unix.go View File

// +build !windows

// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler // This code is heavily inspired by the archived gofacebook/gracenet/net.go handler


//go:build !windows
// +build !windows

package graceful package graceful


import ( import (

+ 3
- 2
modules/graceful/net_windows.go View File

// +build windows

// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler // This code is heavily inspired by the archived gofacebook/gracenet/net.go handler


//go:build windows
// +build windows

package graceful package graceful


import "net" import "net"

+ 3
- 2
modules/graceful/restart_unix.go View File

// +build !windows

// Copyright 2019 The Gitea Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler // This code is heavily inspired by the archived gofacebook/gracenet/net.go handler


//go:build !windows
// +build !windows

package graceful package graceful


import ( import (

+ 1
- 0
modules/lfs/pointer_scanner_gogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gogit
// +build gogit // +build gogit


package lfs package lfs

+ 1
- 0
modules/lfs/pointer_scanner_nogogit.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !gogit
// +build !gogit // +build !gogit


package lfs package lfs

+ 3
- 2
modules/options/dynamic.go View File

// +build !bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !bindata
// +build !bindata

package options package options


import ( import (

+ 2
- 1
modules/options/options_bindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//+build bindata
//go:build bindata
// +build bindata


package options package options



+ 3
- 2
modules/options/static.go View File

// +build bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build bindata
// +build bindata

package options package options


import ( import (

+ 3
- 2
modules/public/dynamic.go View File

// +build !bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !bindata
// +build !bindata

package public package public


import ( import (

+ 2
- 1
modules/public/public_bindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//+build bindata
//go:build bindata
// +build bindata


package public package public



+ 3
- 2
modules/public/static.go View File

// +build bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build bindata
// +build bindata

package public package public


import ( import (

+ 1
- 0
modules/setting/database_sqlite.go View File

//go:build sqlite
// +build sqlite // +build sqlite


// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2014 The Gogs Authors. All rights reserved.

+ 1
- 0
modules/svg/discover_bindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build bindata
// +build bindata // +build bindata


package svg package svg

+ 1
- 0
modules/svg/discover_nobindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !bindata
// +build !bindata // +build !bindata


package svg package svg

+ 3
- 2
modules/templates/dynamic.go View File

// +build !bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !bindata
// +build !bindata

package templates package templates


import ( import (

+ 3
- 2
modules/templates/static.go View File

// +build bindata

// Copyright 2016 The Gitea Authors. All rights reserved. // Copyright 2016 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build bindata
// +build bindata

package templates package templates


import ( import (

+ 2
- 1
modules/templates/templates_bindata.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//+build bindata
//go:build bindata
// +build bindata


package templates package templates



+ 1
- 0
options/locale/locale_en-US.ini View File

clone_in_vsc = Clone in VS Code clone_in_vsc = Clone in VS Code
download_zip = Download ZIP download_zip = Download ZIP
download_tar = Download TAR.GZ download_tar = Download TAR.GZ
download_bundle = Download BUNDLE
generate_repo = Generate Repository generate_repo = Generate Repository
generate_from = Generate From generate_from = Generate From
repo_desc = Description repo_desc = Description

+ 3
- 2
routers/private/manager_unix.go View File

// +build !windows

// Copyright 2020 The Gitea Authors. All rights reserved. // Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !windows
// +build !windows

package private package private


import ( import (

+ 3
- 2
routers/private/manager_windows.go View File

// +build windows

// Copyright 2020 The Gitea Authors. All rights reserved. // Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build windows
// +build windows

package private package private


import ( import (

+ 18
- 7
services/archiver/archiver.go View File

case strings.HasSuffix(uri, ".tar.gz"): case strings.HasSuffix(uri, ".tar.gz"):
ext = ".tar.gz" ext = ".tar.gz"
r.Type = git.TARGZ r.Type = git.TARGZ
case strings.HasSuffix(uri, ".bundle"):
ext = ".bundle"
r.Type = git.BUNDLE
default: default:
return nil, fmt.Errorf("Unknown format: %s", uri) return nil, fmt.Errorf("Unknown format: %s", uri)
} }
} }
}() }()


err = gitRepo.CreateArchive(
graceful.GetManager().ShutdownContext(),
archiver.Type,
w,
setting.Repository.PrefixArchiveFiles,
archiver.CommitID,
)
if archiver.Type == git.BUNDLE {
err = gitRepo.CreateBundle(
graceful.GetManager().ShutdownContext(),
archiver.CommitID,
w,
)
} else {
err = gitRepo.CreateArchive(
graceful.GetManager().ShutdownContext(),
archiver.Type,
w,
setting.Repository.PrefixArchiveFiles,
archiver.CommitID,
)
}
_ = w.CloseWithError(err) _ = w.CloseWithError(err)
done <- err done <- err
}(done, w, archiver, gitRepo) }(done, w, archiver, gitRepo)

+ 1
- 0
services/auth/placeholder.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build !windows
// +build !windows // +build !windows


package auth package auth

+ 1
- 0
templates/repo/home.tmpl View File

</a> </a>
<a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip">{{svg "octicon-file-zip"}}&nbsp;{{.i18n.Tr "repo.download_zip"}}</a> <a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip">{{svg "octicon-file-zip"}}&nbsp;{{.i18n.Tr "repo.download_zip"}}</a>
<a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz">{{svg "octicon-file-zip"}}&nbsp;{{.i18n.Tr "repo.download_tar"}}</a> <a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz">{{svg "octicon-file-zip"}}&nbsp;{{.i18n.Tr "repo.download_tar"}}</a>
<a class="item archive-link" data-url="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.bundle">{{svg "octicon-package"}}&nbsp;{{.i18n.Tr "repo.download_bundle"}}</a>
</div> </div>
</button> </button>
</div> </div>

+ 1
- 0
tools/fuzz.go View File

// Use of this source code is governed by a MIT-style // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.


//go:build gofuzz
// +build gofuzz // +build gofuzz


package fuzz package fuzz

Loading…
Cancel
Save