restage: New git-annex command, handles restaging unlocked files
This is much easier and less failure-prone than having the user run git update-index --refresh themselves. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
f7146c153b
commit
2478e9e03a
10 changed files with 110 additions and 6 deletions
25
Command/Restage.hs
Normal file
25
Command/Restage.hs
Normal file
|
@ -0,0 +1,25 @@
|
|||
{- git-annex command
|
||||
-
|
||||
- Copyright 2022 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Command.Restage where
|
||||
|
||||
import Command
|
||||
import qualified Annex
|
||||
import Annex.Link
|
||||
|
||||
cmd :: Command
|
||||
cmd = command "restage" SectionPlumbing
|
||||
"estages unlocked files in the git index"
|
||||
paramNothing (withParams seek)
|
||||
|
||||
seek :: CmdParams -> CommandSeek
|
||||
seek = withNothing (commandAction start)
|
||||
|
||||
start :: CommandStart
|
||||
start = starting "restage" (ActionItemOther Nothing) (SeekInput []) $ do
|
||||
restagePointerFiles =<< Annex.gitRepo
|
||||
next $ return True
|
|
@ -26,7 +26,7 @@ start ::CommandStart
|
|||
start = go =<< currentView
|
||||
where
|
||||
go Nothing = giveup "Not in a view."
|
||||
go (Just v) = starting "vcycle" (ActionItemOther Nothing) (SeekInput [])$ do
|
||||
go (Just v) = starting "vcycle" (ActionItemOther Nothing) (SeekInput []) $ do
|
||||
let v' = v { viewComponents = vcycle [] (viewComponents v) }
|
||||
if v == v'
|
||||
then do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue