diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-03 13:39:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-03 13:39:07 -0400 |
commit | 9bce151df7b073c5f2507ea15ca2237814ae9248 (patch) | |
tree | 653751d0c0f70475fc1bd7e89d0465fa76b8c630 /Assistant | |
parent | e4fc1c290dba197a16c0e1cc0ff07ecfe2ee542b (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 'Assistant')
-rw-r--r-- | Assistant/MakeRemote.hs | 5 | ||||
-rw-r--r-- | Assistant/Sync.hs | 14 | ||||
-rw-r--r-- | Assistant/Threads/Committer.hs | 8 |
3 files changed, 13 insertions, 14 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs index 479ebd3ff..b01b051f6 100644 --- a/Assistant/MakeRemote.hs +++ b/Assistant/MakeRemote.hs @@ -77,9 +77,8 @@ makeSpecialRemote name remotetype config = do - remote at the location, returns its name. -} makeGitRemote :: String -> String -> Annex String makeGitRemote basename location = makeRemote basename location $ \name -> - void $ inRepo $ - Git.Command.runBool "remote" - [Param "add", Param name, Param location] + void $ inRepo $ Git.Command.runBool + [Param "remote", Param "add", Param name, Param location] {- If there's not already a remote at the location, adds it using the - action, which is passed the name of the remote to make. diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index 613d03980..8546aa318 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -141,13 +141,13 @@ pushToRemotes now notifypushes remotes = do - uuid in them. While ugly, those branches are reserved for pushing by us, - and so our pushes will never conflict with other pushes. -} pushFallback :: UUID -> Git.Ref -> Remote -> Git.Repo -> IO Bool -pushFallback u branch remote = Git.Command.runBool "push" params +pushFallback u branch remote = Git.Command.runBool + [ Param "push" + , Param $ Remote.name remote + , Param $ refspec Annex.Branch.name + , Param $ refspec branch + ] where - params = - [ Param $ Remote.name remote - , Param $ refspec Annex.Branch.name - , Param $ refspec branch - ] {- Push to refs/synced/uuid/branch; this - avoids cluttering up the branch display. -} refspec b = concat @@ -162,7 +162,7 @@ manualPull :: Maybe Git.Ref -> [Remote] -> Assistant ([Bool], Bool) manualPull currentbranch remotes = do g <- liftAnnex gitRepo results <- liftIO $ forM remotes $ \r -> - Git.Command.runBool "fetch" [Param $ Remote.name r] g + Git.Command.runBool [Param "fetch", Param $ Remote.name r] g haddiverged <- liftAnnex Annex.Branch.forceUpdate forM_ remotes $ \r -> liftAnnex $ Command.Sync.mergeRemote r currentbranch diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index bd858ed38..99d01b580 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -81,9 +81,9 @@ commitStaged = do Left _ -> return False Right _ -> do direct <- isDirect - let params = nomessage $ - catMaybes - [ Just $ Param "--quiet" + let params = nomessage $ catMaybes + [ Just $ Param "commit" + , Just $ Param "--quiet" {- In indirect mode, avoid running the - usual git-annex pre-commit hook; - watch does the same symlink fixing, @@ -95,7 +95,7 @@ commitStaged = do - each other out, etc. Git returns nonzero on those, - so don't propigate out commit failures. -} void $ inRepo $ catchMaybeIO . - Git.Command.runQuiet "commit" params + Git.Command.runQuiet params return True where nomessage ps |