mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
Changed commit ref to .git/HEAD
This commit is contained in:
parent
91cee517c5
commit
17a6f3dc89
@ -62,7 +62,7 @@ const (
|
|||||||
frequenciesTmplPath = "internal/code-generator/assets/frequencies.go.tmpl"
|
frequenciesTmplPath = "internal/code-generator/assets/frequencies.go.tmpl"
|
||||||
frequenciesTmpl = "frequencies.go.tmpl"
|
frequenciesTmpl = "frequencies.go.tmpl"
|
||||||
|
|
||||||
commitPath = ".linguist/.git/refs/heads/master"
|
commitPath = ".linguist/.git/HEAD"
|
||||||
)
|
)
|
||||||
|
|
||||||
type generatorFiles struct {
|
type generatorFiles struct {
|
||||||
@ -106,5 +106,15 @@ func getCommit(path string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if string(commit) == "ref: refs/heads/master\n" {
|
||||||
|
path = ".linguist/.git/" + string(commit[5:len(commit)-1])
|
||||||
|
commit, err := ioutil.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(commit), nil
|
||||||
|
}
|
||||||
|
|
||||||
return string(commit), nil
|
return string(commit), nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user