add: Adding a v6 pointer file used to annex it; now the pointer file is added to git as-is.
(git add of a pointer file already did the right thing)
This commit is contained in:
parent
4efc26ca6c
commit
76170b0457
2 changed files with 20 additions and 3 deletions
|
@ -17,7 +17,9 @@ import qualified Annex.Queue
|
|||
import qualified Database.Keys
|
||||
import Config
|
||||
import Annex.FileMatcher
|
||||
import Annex.Link
|
||||
import Annex.Version
|
||||
import Git.FilePath
|
||||
|
||||
cmd :: Command
|
||||
cmd = notBareRepo $ withGlobalOptions (jobsOption : jsonOption : fileMatchingOptions) $
|
||||
|
@ -80,8 +82,15 @@ addFile file = do
|
|||
return True
|
||||
|
||||
start :: FilePath -> CommandStart
|
||||
start file = ifAnnexed file addpresent add
|
||||
start file = do
|
||||
ifM versionSupportsUnlockedPointers
|
||||
( do
|
||||
mk <- liftIO $ isPointerFile file
|
||||
maybe go fixuppointer mk
|
||||
, go
|
||||
)
|
||||
where
|
||||
go = ifAnnexed file addpresent add
|
||||
add = do
|
||||
ms <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file
|
||||
case ms of
|
||||
|
@ -114,9 +123,14 @@ start file = ifAnnexed file addpresent add
|
|||
-- the annexed symlink is present but not yet added to git
|
||||
showStart "add" file
|
||||
liftIO $ removeFile file
|
||||
next $ next $ do
|
||||
addLink file key Nothing
|
||||
addLink file key Nothing
|
||||
next $ next $
|
||||
cleanup key =<< inAnnex key
|
||||
fixuppointer key = do
|
||||
-- the pointer file is present, but not yet added to git
|
||||
showStart "add" file
|
||||
Database.Keys.addAssociatedFile key =<< inRepo (toTopFilePath file)
|
||||
next $ next $ addFile file
|
||||
|
||||
perform :: FilePath -> CommandPerform
|
||||
perform file = do
|
||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -10,6 +10,9 @@ git-annex (6.20160512) UNRELEASED; urgency=medium
|
|||
assistant.
|
||||
* assistant: Fix race in v6 mode that caused downloaded file content to
|
||||
sometimes not replace pointer files.
|
||||
* add: Adding a v6 pointer file used to annex it; now the pointer file is
|
||||
added to git as-is. (git add of a pointer file already did the right
|
||||
thing)
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Wed, 11 May 2016 16:08:38 -0400
|
||||
|
||||
|
|
Loading…
Reference in a new issue