mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
deps: Upgrade github.com/bep/gitmap v1.4.0 => v1.6.0 (note)
Closes #8627
This commit is contained in:
parent
439f07eac4
commit
7be0377505
6 changed files with 28 additions and 7 deletions
|
@ -14,11 +14,13 @@
|
|||
package hugolib
|
||||
|
||||
import (
|
||||
"io"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/bep/gitmap"
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/common/hexec"
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/resources/page"
|
||||
"github.com/gohugoio/hugo/source"
|
||||
)
|
||||
|
@ -38,10 +40,24 @@ func (g *gitInfo) forPage(p page.Page) source.GitInfo {
|
|||
return source.NewGitInfo(*gi)
|
||||
}
|
||||
|
||||
func newGitInfo(conf config.AllProvider) (*gitInfo, error) {
|
||||
workingDir := conf.BaseConfig().WorkingDir
|
||||
func newGitInfo(d *deps.Deps) (*gitInfo, error) {
|
||||
opts := gitmap.Options{
|
||||
Repository: d.Conf.BaseConfig().WorkingDir,
|
||||
GetGitCommandFunc: func(stdout, stderr io.Writer, args ...string) (gitmap.Runner, error) {
|
||||
var argsv []any
|
||||
for _, arg := range args {
|
||||
argsv = append(argsv, arg)
|
||||
}
|
||||
argsv = append(
|
||||
argsv,
|
||||
hexec.WithStdout(stdout),
|
||||
hexec.WithStderr(stderr),
|
||||
)
|
||||
return d.ExecHelper.New("git", argsv...)
|
||||
},
|
||||
}
|
||||
|
||||
gitRepo, err := gitmap.Map(workingDir, "")
|
||||
gitRepo, err := gitmap.Map(opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue