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
git union-merge newref ref ref
git union-merge ref ref newref
# DESCRIPTION
@ -20,7 +20,7 @@ entirely on git refs and branches.
# 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,
storing the result in the git-annex branch.

View file

@ -26,10 +26,10 @@ usage = error $ "bad parameters\n\n" ++ header
main :: IO ()
main = do
[branch, aref, bref] <- parseArgs
[aref, bref, newref] <- parseArgs
g <- setup
stage g aref bref
commit g branch aref bref
commit g aref bref newref
cleanup g
parseArgs :: IO [String]
@ -103,13 +103,13 @@ stage g aref bref = do
{- Commits the index into the specified branch. -}
commit :: Git.Repo -> String -> String -> String -> IO ()
commit g branch aref bref = do
commit g aref bref newref = do
tree <- getSha "write-tree" $
pipeFrom "git" ["write-tree"]
sha <- getSha "commit-tree" $
pipeBoth "git" ["commit-tree", tree, "-p", aref, "-p", bref]
"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
any trailing newline, returning the sha. -}