remove Read instance for Ref

Removed instance, got it all to build using fromRef. (With a few things
that really need to show something using a ref for debugging stubbed out.)

Then added back Read instance, and made Logs.View use it for serialization.
This changes the view log format.
This commit is contained in:
Joey Hess 2014-02-19 01:09:17 -04:00
parent eb7b8747f9
commit 4e0be2792b
32 changed files with 101 additions and 104 deletions

View file

@ -192,12 +192,12 @@ pushLocal (Just branch) = do
updateBranch :: Git.Ref -> Git.Repo -> IO ()
updateBranch syncbranch g =
unlessM go $ error $ "failed to update " ++ show syncbranch
unlessM go $ error $ "failed to update " ++ Git.fromRef syncbranch
where
go = Git.Command.runBool
[ Param "branch"
, Param "-f"
, Param $ show $ Git.Ref.base syncbranch
, Param $ Git.fromRef $ Git.Ref.base syncbranch
] g
pullRemote :: Remote -> Maybe Git.Ref -> CommandStart
@ -283,15 +283,15 @@ pushBranch remote branch g = tryIO (directpush g) `after` syncpush g
, refspec branch
]
directpush = Git.Command.runQuiet $ pushparams
[show $ Git.Ref.base $ fromDirectBranch branch]
[Git.fromRef $ Git.Ref.base $ fromDirectBranch branch]
pushparams branches =
[ Param "push"
, Param $ Remote.name remote
] ++ map Param branches
refspec b = concat
[ show $ Git.Ref.base b
[ Git.fromRef $ Git.Ref.base b
, ":"
, show $ Git.Ref.base $ syncBranch b
, Git.fromRef $ Git.Ref.base $ syncBranch b
]
commitAnnex :: CommandStart