summaryrefslogtreecommitdiffstats
path: root/pkg/commands/loading_files.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-29 20:03:39 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 20:48:49 +1000
commit72af7e41778bca93d82fa668641f515fba1d92bc (patch)
tree7e755e857be72205ee99641d5eb5d4556151ad8f /pkg/commands/loading_files.go
parent1767f91047a35318f6b1e469199c8a7f547f2afc (diff)
factor out code from git.go
Diffstat (limited to 'pkg/commands/loading_files.go')
-rw-r--r--pkg/commands/loading_files.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/commands/loading_files.go b/pkg/commands/loading_files.go
index d68dcd726..8455ed0d5 100644
--- a/pkg/commands/loading_files.go
+++ b/pkg/commands/loading_files.go
@@ -8,6 +8,11 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
+// GetStatusFiles git status files
+type GetStatusFileOptions struct {
+ NoRenames bool
+}
+
func (c *GitCommand) GetStatusFiles(opts GetStatusFileOptions) []*models.File {
// check if config wants us ignoring untracked files
untrackedFilesSetting := c.GetConfigValue("status.showUntrackedFiles")
@@ -82,7 +87,7 @@ func (c *GitCommand) MergeStatusFiles(oldFiles, newFiles []*models.File, selecte
result := []*models.File{}
for _, oldFile := range oldFiles {
for newIndex, newFile := range newFiles {
- if includesInt(appendedIndexes, newIndex) {
+ if utils.IncludesInt(appendedIndexes, newIndex) {
continue
}
// if we just staged B and in doing so created 'A -> B' and we are currently have oldFile: A and newFile: 'A -> B', we want to wait until we come across B so the our cursor isn't jumping anywhere
@@ -97,7 +102,7 @@ func (c *GitCommand) MergeStatusFiles(oldFiles, newFiles []*models.File, selecte
// append any new files to the end
for index, newFile := range newFiles {
- if !includesInt(appendedIndexes, index) {
+ if !utils.IncludesInt(appendedIndexes, index) {
result = append(result, newFile)
}
}