diff options
-rw-r--r-- | Annex/Branch.hs | 29 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 15 insertions, 16 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 2cba28901..6578471bc 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -151,33 +151,30 @@ updateTo pairs = do (nub $ fullname:refs) liftIO cleanjournal -{- Gets the content of a file, which may be in the journal, or committed - - to the branch. Due to limitatons of git cat-file, does *not* get content - - that has only been staged to the index. +{- Gets the content of a file, which may be in the journal, or in the index + - (and committed to the branch). - - Updates the branch if necessary, to ensure the most up-to-date available - content is available. - - Returns an empty string if the file doesn't exist yet. -} get :: FilePath -> Annex String -get = get' False +get file = do + update + get' file {- Like get, but does not merge the branch, so the info returned may not - - reflect changes in remotes. (Changing the value this returns, and then - - merging is always the same as using get, and then changing its value.) -} + - reflect changes in remotes. + - (Changing the value this returns, and then merging is always the + - same as using get, and then changing its value.) -} getStale :: FilePath -> Annex String -getStale = get' True +getStale = get' -get' :: Bool -> FilePath -> Annex String -get' staleok file = fromjournal =<< getJournalFile file +get' :: FilePath -> Annex String +get' file = go =<< getJournalFile file where - fromjournal (Just content) = return content - fromjournal Nothing - | staleok = withIndex frombranch - | otherwise = do - update - frombranch - frombranch = withIndex $ L.unpack <$> catFile fullname file + go (Just journalcontent) = return journalcontent + go Nothing = withIndex $ L.unpack <$> catFile fullname file {- Applies a function to modifiy the content of a file. - diff --git a/debian/changelog b/debian/changelog index 91265bef4..2f4917c91 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ git-annex (4.20130517) UNRELEASED; urgency=low * Direct mode bug fix: After a conflicted merge was automatically resolved, the content of a file that was already present could incorrectly be replaced with a symlink. + * Fix a bug in the git-annex branch handling code that could + cause info from a remote to not be merged and take effect immediately. * Direct mode is now fully tested by the test suite. -- Joey Hess <joeyh@debian.org> Fri, 17 May 2013 11:17:03 -0400 |