diff options
-rw-r--r-- | Command/Uninit.hs | 23 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/bugs/uninit_loses_data_if_git-annex_add_didn__39__t_complete.mdwn | 1 |
3 files changed, 18 insertions, 8 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs index 6ac3e1216..8b653da7d 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -36,7 +36,20 @@ check = do [Params "rev-parse --abbrev-ref HEAD"] seek :: [CommandSeek] -seek = [withFilesInGit $ whenAnnexed startUnannex, withNothing start] +seek = [ + withFilesNotInGit $ whenAnnexed startCheckIncomplete, + withFilesInGit $ whenAnnexed startUnannex + , withNothing start + ] + +{- git annex symlinks that are not checked into git could be left by an + - interrupted add. -} +startCheckIncomplete :: FilePath -> (Key, Backend) -> CommandStart +startCheckIncomplete file _ = error $ unlines + [ file ++ " points to annexed content, but is not checked into git." + , "Perhaps this was left behind by an interrupted git annex add?" + , "Not continuing with uninit; either delete or git annex add the file and retry." + ] startUnannex :: FilePath -> (Key, Backend) -> CommandStart startUnannex file info = do @@ -47,13 +60,7 @@ startUnannex file info = do Command.Unannex.start file info start :: CommandStart -start = next perform - -perform :: CommandPerform -perform = next cleanup - -cleanup :: CommandCleanup -cleanup = do +start = next $ next $ do annexdir <- fromRepo gitAnnexDir uninitialize mapM_ removeAnnex =<< getKeysPresent diff --git a/debian/changelog b/debian/changelog index 4da5330bc..e55284c4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ git-annex (3.20121018) UNRELEASED; urgency=low * file:/// URLs can now be used with the web special remote. * OSX: Stop installing non-self-contained webapp into Desktop directory. * webapp: Allow dashes in ssh key comments when pairing. + * uninit: Check and abort if there are symlinks to annexed content that + are not checked into git. -- Joey Hess <joeyh@debian.org> Wed, 17 Oct 2012 14:24:10 -0400 diff --git a/doc/bugs/uninit_loses_data_if_git-annex_add_didn__39__t_complete.mdwn b/doc/bugs/uninit_loses_data_if_git-annex_add_didn__39__t_complete.mdwn index 6b5749eaf..61cfa89a5 100644 --- a/doc/bugs/uninit_loses_data_if_git-annex_add_didn__39__t_complete.mdwn +++ b/doc/bugs/uninit_loses_data_if_git-annex_add_didn__39__t_complete.mdwn @@ -12,3 +12,4 @@ I know there are two conflicting issues here: Maybe uninit could check to see if all symlinks currently in the repo pointing to something under .git/annex/objects are committed. If not, commit them then uninit, or just de-annex them. +> Added a check for this, [[done]] --[[Joey]] |