reorder git-union-merge params

This commit is contained in:
Joey Hess 2011-06-20 21:42:17 -04:00
parent 01e8a0a9e5
commit 8b749d4bfd
2 changed files with 6 additions and 6 deletions

View file

@ -4,7 +4,7 @@ git-union-merge - Join branches together using a union merge
# SYNOPSIS # SYNOPSIS
git union-merge newref ref ref git union-merge ref ref newref
# DESCRIPTION # DESCRIPTION
@ -20,7 +20,7 @@ entirely on git refs and branches.
# EXAMPLE # EXAMPLE
git union-merge refs/heads/git-annex git-annex origin/git-annex git union-merge git-annex origin/git-annex refs/heads/git-annex
Merges the current git-annex branch, and a version from origin, Merges the current git-annex branch, and a version from origin,
storing the result in the git-annex branch. storing the result in the git-annex branch.

View file

@ -26,10 +26,10 @@ usage = error $ "bad parameters\n\n" ++ header
main :: IO () main :: IO ()
main = do main = do
[branch, aref, bref] <- parseArgs [aref, bref, newref] <- parseArgs
g <- setup g <- setup
stage g aref bref stage g aref bref
commit g branch aref bref commit g aref bref newref
cleanup g cleanup g
parseArgs :: IO [String] parseArgs :: IO [String]
@ -103,13 +103,13 @@ stage g aref bref = do
{- Commits the index into the specified branch. -} {- Commits the index into the specified branch. -}
commit :: Git.Repo -> String -> String -> String -> IO () commit :: Git.Repo -> String -> String -> String -> IO ()
commit g branch aref bref = do commit g aref bref newref = do
tree <- getSha "write-tree" $ tree <- getSha "write-tree" $
pipeFrom "git" ["write-tree"] pipeFrom "git" ["write-tree"]
sha <- getSha "commit-tree" $ sha <- getSha "commit-tree" $
pipeBoth "git" ["commit-tree", tree, "-p", aref, "-p", bref] pipeBoth "git" ["commit-tree", tree, "-p", aref, "-p", bref]
"union merge" "union merge"
Git.run g "update-ref" [Param branch, Param sha] Git.run g "update-ref" [Param newref, Param sha]
{- Runs an action that causes a git subcommand to emit a sha, and strips {- Runs an action that causes a git subcommand to emit a sha, and strips
any trailing newline, returning the sha. -} any trailing newline, returning the sha. -}