summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorguillep2k <github.com@mailfilter.com.ar>2019-08-02 12:14:50 -0300
committerLunny Xiao <xiaolunwen@gmail.com>2019-08-02 23:14:50 +0800
commit3566d2c860b0ad3ab7d6d5fb1490eb9a5b5f5974 (patch)
treebcda45d54f63297f97f60d42cd505a438f9a0d91 /modules/git
parent06392479b44f4af913a9067fba6d4947ed323235 (diff)
downloadgitea-3566d2c860b0ad3ab7d6d5fb1490eb9a5b5f5974.tar.gz
gitea-3566d2c860b0ad3ab7d6d5fb1490eb9a5b5f5974.zip
Include "executable" files in the index, as they are not necessarily binary (#7718)
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/tree_entry.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/git/tree_entry.go b/modules/git/tree_entry.go
index 6019e34487..4e18cc8ead 100644
--- a/modules/git/tree_entry.go
+++ b/modules/git/tree_entry.go
@@ -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)