commands that actually need it.
* Fix building with the Assistant build flag disabled but the Webapp
build flag enabled.
+ * add: Fix reversion when adding an annex link that has been moved to
+ another directory. (Introduced in version 10.20220624)
-- Joey Hess <id@joeyh.name> Tue, 28 Jun 2022 14:49:17 -0400
starting "add" (ActionItemTreeFile file) si $
addingExistingLink file key $
withOtherTmp $ \tmp -> do
- let tmpf = tmp P.</> file
+ let tmpf = tmp P.</> P.takeFileName file
liftIO $ moveFile file tmpf
ifM (isSymbolicLink <$> liftIO (R.getSymbolicLinkStatus tmpf))
( do
import qualified Utility.FileSystemEncoding
import qualified Utility.Aeson
import qualified Utility.CopyFile
+import qualified Utility.MoveFile
import qualified Types.Remote
#ifndef mingw32_HOST_OS
import qualified Remote.Helper.Encryptable
repoTests note numparts = map mk $ sep
[ testCase "add dup" test_add_dup
, testCase "add extras" test_add_extras
+ , testCase "add moved link" test_add_moved
, testCase "readonly remote" test_readonly_remote
, testCase "ignore deleted files" test_ignore_deleted_files
, testCase "metadata" test_metadata
annexed_present wormannexedfile
checkbackend wormannexedfile backendWORM
+test_add_moved :: Assertion
+test_add_moved = intmpclonerepo $ do
+ git_annex "get" [annexedfile] "get failed"
+ annexed_present annexedfile
+ createDirectory subdir
+ Utility.MoveFile.moveFile (toRawFilePath annexedfile) (toRawFilePath subfile)
+ git_annex "add" [subdir] "add of moved annexed file"
+ where
+ subdir = "subdir"
+ subfile = subdir </> "file"
+
test_readonly_remote :: Assertion
test_readonly_remote =
#ifndef mingw32_HOST_OS