mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
cmd/go/internal/modfetch/codehost: add support for new fossil info hash prefix
A recent update of the Fossil SCM application changes the line prefix when the fossil info command is used. Instead of the revision hash starting with "uuid:", it has been changed to "hash:". Fossil check-in introducing this change: https://fossil-scm.org/home/info/8ad5e4690854a81a To support both older and new versions of fossil, fossilParseStat will now check for either version of the prefix when attempting to find the line containing the hash of the desired revision. Fixes https://github.com/golang/go/issues/42323
This commit is contained in:
parent
bff4d99637
commit
f4e6652307
1 changed files with 1 additions and 1 deletions
|
@ -568,7 +568,7 @@ func bzrParseStat(rev, out string) (*RevInfo, error) {
|
|||
|
||||
func fossilParseStat(rev, out string) (*RevInfo, error) {
|
||||
for _, line := range strings.Split(out, "\n") {
|
||||
if strings.HasPrefix(line, "uuid:") {
|
||||
if strings.HasPrefix(line, "uuid:") || strings.HasPrefix(line, "hash:") {
|
||||
f := strings.Fields(line)
|
||||
if len(f) != 5 || len(f[1]) != 40 || f[4] != "UTC" {
|
||||
return nil, vcsErrorf("unexpected response from fossil info: %q", line)
|
||||
|
|
Loading…
Reference in a new issue