Skip to content

Commit

Permalink
feat(return): Updated return to have info for stash list
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphabetsAlphabets committed May 6, 2024
1 parent b99080a commit 4098f2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/neogit/lib/git/stash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local M = {}

---@class StashEntry
---@field stash_id string the id of the stash i.e. stash@{7}
---@field rel_date string relative timestamp
---@field message string the message associated with each stash.

local function perform_stash(include)
Expand Down Expand Up @@ -129,7 +130,13 @@ function M.register(meta)
state.stashes.items = util.map(M.list(), function(line)
local idx, message = line:match("stash@{(%d*)}: (.*)")

---@class StashEntry
return {
rel_date = cli.log
.max_count(1)
.format("%cr")
.args("stash@{" .. idx .. "}")
.call({ hidden = true }).stdout[1],
idx = tonumber(idx),
name = line,
message = message,
Expand Down

0 comments on commit 4098f2e

Please sign in to comment.