Skip to content

Commit

Permalink
Include "executable" files in the index, as they are not necessarily …
Browse files Browse the repository at this point in the history
…binary (#7718)
  • Loading branch information
guillep2k authored and lunny committed Aug 2, 2019
1 parent 0639247 commit 3566d2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion models/repo_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func addDelete(filename string, repo *Repository, batch rupture.FlushingBatch) e
}

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
Expand Down
5 changes: 5 additions & 0 deletions modules/git/tree_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3566d2c

Please sign in to comment.