mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Make stashEntryFromLine a free-standing function
It doesn't use the receiver at all, so doesn't have to be a method. This fixes ST1016: methods on the same type should have the same receiver name.
This commit is contained in:
@ -53,7 +53,7 @@ outer:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return self.getUnfilteredStashEntries()
|
return self.getUnfilteredStashEntries()
|
||||||
}
|
}
|
||||||
currentStashEntry = self.stashEntryFromLine(lines[i], idx)
|
currentStashEntry = stashEntryFromLine(lines[i], idx)
|
||||||
for i+1 < len(lines) && !isAStash(lines[i+1]) {
|
for i+1 < len(lines) && !isAStash(lines[i+1]) {
|
||||||
i++
|
i++
|
||||||
if lines[i] == filterPath {
|
if lines[i] == filterPath {
|
||||||
@ -70,11 +70,11 @@ func (self *StashLoader) getUnfilteredStashEntries() []*models.StashEntry {
|
|||||||
|
|
||||||
rawString, _ := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
rawString, _ := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
||||||
return lo.Map(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry {
|
return lo.Map(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry {
|
||||||
return self.stashEntryFromLine(line, index)
|
return stashEntryFromLine(line, index)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *StashLoader) stashEntryFromLine(line string, index int) *models.StashEntry {
|
func stashEntryFromLine(line string, index int) *models.StashEntry {
|
||||||
model := &models.StashEntry{
|
model := &models.StashEntry{
|
||||||
Name: line,
|
Name: line,
|
||||||
Index: index,
|
Index: index,
|
||||||
|
Reference in New Issue
Block a user