diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-19 01:09:17 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-19 01:19:57 -0400 |
commit | 51c12a76ef54affaf9428232fde4f2c3e30e7488 (patch) | |
tree | 4cb2699e2b410260e383d3bf6da14d502aa0d0dc /Annex/Direct.hs | |
parent | b5b5ead4b28fd08100bcac9cb9482263bac3a64e (diff) |
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.
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r-- | Annex/Direct.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 495ce0d60..4a23fcc6c 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -286,18 +286,18 @@ setDirect wantdirect = do - this way things that show HEAD (eg shell prompts) will - hopefully show just "master". -} directBranch :: Ref -> Ref -directBranch orighead = case split "/" $ show orighead of +directBranch orighead = case split "/" $ fromRef orighead of ("refs":"heads":"annex":"direct":_) -> orighead ("refs":"heads":rest) -> Ref $ "refs/heads/annex/direct/" ++ intercalate "/" rest - _ -> Ref $ "refs/heads/" ++ show (Git.Ref.base orighead) + _ -> Ref $ "refs/heads/" ++ fromRef (Git.Ref.base orighead) {- Converts a directBranch back to the original branch. - - Any other ref is left unchanged. -} fromDirectBranch :: Ref -> Ref -fromDirectBranch directhead = case split "/" $ show directhead of +fromDirectBranch directhead = case split "/" $ fromRef directhead of ("refs":"heads":"annex":"direct":rest) -> Ref $ "refs/heads/" ++ intercalate "/" rest _ -> directhead |