From 1cabf96c4b5f45bff9b318115cec109955a618f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Dec 2013 15:57:09 -0400 Subject: Fix direct mode's handling when modifications to non-annexed files are pulled from a remote. A bug prevented the files from being updated in the work tree, and this caused the modification to be reverted. --- Annex/Direct.hs | 8 ++++---- debian/changelog | 3 +++ ...pository__44___git_annex_delete_non_annexed_new_git_files.mdwn | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 5d4b6a402..340c5c475 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -181,14 +181,14 @@ mergeDirectCleanup d oldsha newsha = do go getsha getmode a araw (f, item) | getsha item == nullSha = noop | otherwise = void $ - tryAnnex . maybe (araw f) (\k -> void $ a k f) + tryAnnex . maybe (araw f item) (\k -> void $ a k f) =<< catKey (getsha item) (getmode item) moveout k f = removeDirect k f {- Files deleted by the merge are removed from the work tree. - Empty work tree directories are removed, per git behavior. -} - moveout_raw f = liftIO $ do + moveout_raw f _item = liftIO $ do nukeFile f void $ tryIO $ removeDirectory $ parentDir f @@ -202,9 +202,9 @@ mergeDirectCleanup d oldsha newsha = do {- Any new, modified, or renamed files were written to the temp - directory by the merge, and are moved to the real work tree. -} - movein_raw f = liftIO $ do + movein_raw f item = liftIO $ do createDirectoryIfMissing True $ parentDir f - void $ tryIO $ rename (d f) f + void $ tryIO $ rename (d getTopFilePath (DiffTree.file item)) f {- If possible, converts a symlink in the working tree into a direct - mode file. If the content is not available, leaves the symlink diff --git a/debian/changelog b/debian/changelog index 9eb68ce77..8af731481 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,9 @@ git-annex (5.20131131) UNRELEASED; urgency=low * repair: Improve repair of git-annex index file. * repair: Remove damaged git-annex sync branches. * status: Ignore new files that are gitignored. + * Fix direct mode's handling when modifications to non-annexed files + are pulled from a remote. A bug prevented the files from being updated + in the work tree, and this caused the modification to be reverted. -- Joey Hess Sun, 01 Dec 2013 13:57:58 -0400 diff --git a/doc/bugs/when_syncing_a_direct_repository__44___git_annex_delete_non_annexed_new_git_files.mdwn b/doc/bugs/when_syncing_a_direct_repository__44___git_annex_delete_non_annexed_new_git_files.mdwn index ddb3f1399..2a756cc4d 100644 --- a/doc/bugs/when_syncing_a_direct_repository__44___git_annex_delete_non_annexed_new_git_files.mdwn +++ b/doc/bugs/when_syncing_a_direct_repository__44___git_annex_delete_non_annexed_new_git_files.mdwn @@ -51,3 +51,5 @@ git annex sync ls # End of transcript or log. """]] + +> [[fixed|done]] --[[Joey]] -- cgit v1.2.3