From 84d3896d675da84a7f6bf23619a8b17da9ab9eb7 Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 23 Oct 2024 19:33:58 +0200 Subject: [PATCH] git: restore - support `--source` --- completers/git_completer/cmd/restore.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/completers/git_completer/cmd/restore.go b/completers/git_completer/cmd/restore.go index c2138366cb..db92c6ad7e 100644 --- a/completers/git_completer/cmd/restore.go +++ b/completers/git_completer/cmd/restore.go @@ -46,6 +46,10 @@ func init() { if restoreCmd.Flag("staged").Changed { return git.ActionChanges(git.ChangeOpts{Staged: true}).FilterArgs() } + + if f := restoreCmd.Flag("source"); f.Changed { + return git.ActionRefDiffs(f.Value.String()) + } return git.ActionChanges(git.ChangeOpts{Unstaged: true}).FilterArgs() }), )