mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 13:17:53 +01:00
Include "executable" files in the index, as they are not necessarily binary (#7718)
This commit is contained in:
parent
06392479b4
commit
3566d2c860
@ -232,7 +232,7 @@ func addDelete(filename string, repo *Repository, batch rupture.FlushingBatch) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isIndexable(entry *git.TreeEntry) bool {
|
func isIndexable(entry *git.TreeEntry) bool {
|
||||||
return entry.IsRegular()
|
return entry.IsRegular() || entry.IsExecutable()
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseGitLsTreeOutput parses the output of a `git ls-tree -r --full-name` command
|
// parseGitLsTreeOutput parses the output of a `git ls-tree -r --full-name` command
|
||||||
|
@ -108,6 +108,11 @@ func (te *TreeEntry) IsRegular() bool {
|
|||||||
return te.gogitTreeEntry.Mode == filemode.Regular
|
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
|
// Blob returns the blob object the entry
|
||||||
func (te *TreeEntry) Blob() *Blob {
|
func (te *TreeEntry) Blob() *Blob {
|
||||||
encodedObj, err := te.ptree.repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, te.gogitTreeEntry.Hash)
|
encodedObj, err := te.ptree.repo.gogitRepo.Storer.EncodedObject(plumbing.AnyObject, te.gogitTreeEntry.Hash)
|
||||||
|
Loading…
Reference in New Issue
Block a user