Merge branch 'master' into enh/noid/commit-message-link-check-commit-hashes
This commit is contained in:
@@ -108,6 +108,11 @@ func (te *TreeEntry) IsRegular() bool {
|
||||
return te.gogitTreeEntry.Mode == filemode.Regular
|
||||
}
|
||||
|
||||
// IsExecutable if the entry is an executable file (not necessarily binary)
|
||||
func (te *TreeEntry) IsExecutable() bool {
|
||||
return te.gogitTreeEntry.Mode == filemode.Executable
|
||||
}
|
||||
|
||||
// Blob returns the blob object the entry
|
||||
func (te *TreeEntry) Blob() *Blob {
|
||||
encodedObj, err := te.ptree.repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, te.gogitTreeEntry.Hash)
|
||||
|
||||
@@ -19,9 +19,11 @@ var (
|
||||
}
|
||||
|
||||
// File names that are representing highlight classes.
|
||||
highlightFileNames = map[string]bool{
|
||||
"dockerfile": true,
|
||||
"makefile": true,
|
||||
highlightFileNames = map[string]string{
|
||||
"dockerfile": "dockerfile",
|
||||
"makefile": "makefile",
|
||||
"gnumakefile": "makefile",
|
||||
"cmakelists.txt": "cmake",
|
||||
}
|
||||
|
||||
// Extensions that are same as highlight classes.
|
||||
@@ -87,8 +89,8 @@ func FileNameToHighlightClass(fname string) string {
|
||||
return "nohighlight"
|
||||
}
|
||||
|
||||
if highlightFileNames[fname] {
|
||||
return fname
|
||||
if name, ok := highlightFileNames[fname]; ok {
|
||||
return name
|
||||
}
|
||||
|
||||
ext := path.Ext(fname)
|
||||
|
||||
Reference in New Issue
Block a user