summaryrefslogtreecommitdiff
path: root/Command/Unannex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-03 13:39:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-03 13:39:07 -0400
commit9bce151df7b073c5f2507ea15ca2237814ae9248 (patch)
tree653751d0c0f70475fc1bd7e89d0465fa76b8c630 /Command/Unannex.hs
parente4fc1c290dba197a16c0e1cc0ff07ecfe2ee542b (diff)
git subcommand cleanup
Pass subcommand as a regular param, which allows passing git parameters like -c before it. This was already done in the pipeing set of functions, but not the command running set.
Diffstat (limited to 'Command/Unannex.hs')
-rw-r--r--Command/Unannex.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 0e691710a..d1f27e86a 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -34,7 +34,7 @@ cleanup :: FilePath -> Key -> CommandCleanup
cleanup file key = do
liftIO $ removeFile file
-- git rm deletes empty directory without --cached
- inRepo $ Git.Command.run "rm" [Params "--cached --quiet --", File file]
+ inRepo $ Git.Command.run [Params "rm --cached --quiet --", File file]
-- If the file was already committed, it is now staged for removal.
-- Commit that removal now, to avoid later confusing the
@@ -42,10 +42,12 @@ cleanup file key = do
-- git as a normal, non-annexed file.
(s, clean) <- inRepo $ LsFiles.staged [file]
when (not $ null s) $ do
- inRepo $ Git.Command.run "commit" [
- Param "-q",
- Params "-m", Param "content removed from git annex",
- Param "--", File file]
+ inRepo $ Git.Command.run
+ [ Param "commit"
+ , Param "-q"
+ , Param "-m", Param "content removed from git annex"
+ , Param "--", File file
+ ]
void $ liftIO clean
ifM (Annex.getState Annex.fast)