diff options
author | Joey Hess <joeyh@joeyh.name> | 2024-04-02 17:29:07 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2024-04-02 17:29:07 -0400 |
commit | a8dd85ea5a9f8515819db04b9f1d154488193e7d (patch) | |
tree | 2b3b9db1729edd82d58fc29b9660afc79fc12c8e /Git/Branch.hs | |
parent | 2b0df3a76d9d0b5557d41824c11614fd41741651 (diff) |
Revert "multiple -m"
This reverts commit cee12f6a2fd7f90eb2aa72cd638b6bcdf45e4f92.
This commit broke git-annex init run in a repo that was cloned from a
repo with an adjusted branch checked out.
The problem is that findAdjustingCommit was not able to identify the
commit that created the adjusted branch. It seems that there is an extra
"\n" at the end of the commit message that it does not expect.
Since backwards compatability needs to be maintained, cannot just make
findAdjustingCommit accept it with the "\n". Will have to instead
have one commitTree variant that uses the old method, and use it for
adjusted branch committing.
Diffstat (limited to 'Git/Branch.hs')
-rw-r--r-- | Git/Branch.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Git/Branch.hs b/Git/Branch.hs index 40ddaf78d8..f30e3572f2 100644 --- a/Git/Branch.hs +++ b/Git/Branch.hs @@ -178,7 +178,7 @@ commit commitmode allowempty message branch parentrefs repo = do tree <- writeTree repo ifM (cancommit tree) ( do - sha <- commitTree commitmode [message] parentrefs tree repo + sha <- commitTree commitmode message parentrefs tree repo update' branch sha repo return $ Just sha , return Nothing @@ -207,15 +207,15 @@ writeTreeQuiet repo = extractSha <$> withNullHandle go go nullh = pipeReadStrict' (\p -> p { std_err = UseHandle nullh }) [Param "write-tree"] repo -commitTree :: CommitMode -> [String] -> [Ref] -> Ref -> Repo -> IO Sha -commitTree commitmode messages parentrefs tree repo = - getSha "commit-tree" $ pipeReadStrict ps repo +commitTree :: CommitMode -> String -> [Ref] -> Ref -> Repo -> IO Sha +commitTree commitmode message parentrefs tree repo = + getSha "commit-tree" $ + pipeWriteRead ([Param "commit-tree", Param (fromRef tree)] ++ ps) + sendmsg repo where - ps = [Param "commit-tree", Param (fromRef tree)] - ++ applyCommitModeForCommitTree commitmode baseparams repo - baseparams = map Param $ - concatMap (\r -> ["-p", fromRef r]) parentrefs - ++ concatMap (\msg -> ["-m", msg]) messages + sendmsg = Just $ flip hPutStr message + ps = applyCommitModeForCommitTree commitmode parentparams repo + parentparams = map Param $ concatMap (\r -> ["-p", fromRef r]) parentrefs {- A leading + makes git-push force pushing a branch. -} forcePush :: String -> String |