import: Changed how --deduplicate, --skip-duplicates, and --clean-duplicates determine if a file is a duplicate
Before, only content known to be present somewhere was considered a duplicate. Now, any content that has been annexed before will be considered a duplicate, even if all annexed copies of the data have been lost. Note that --clean-duplicates and --deduplicate still check numcopies, so won't delete duplicate files unless there's an annexed copy. This makes import use the same method as reinject --known. The man page already said that duplicate meant "its content is either present in the local repository already, or git-annex knows of another repository that contains it, or it was present in the annex before but has been removed now". So, this is really only bringing the implementation into line with the man page. This commit was sponsored by Jochen Bartl on Patreon.
This commit is contained in:
parent
a8e64d4148
commit
e7e36b6e72
3 changed files with 13 additions and 3 deletions
|
@ -18,6 +18,7 @@ import Types.KeySource
|
|||
import Annex.CheckIgnore
|
||||
import Annex.NumCopies
|
||||
import Annex.FileMatcher
|
||||
import Logs.Location
|
||||
|
||||
cmd :: Command
|
||||
cmd = withGlobalOptions (jobsOption : jsonOption : fileMatchingOptions) $ notBareRepo $
|
||||
|
@ -136,7 +137,7 @@ start largematcher mode (srcfile, destfile) =
|
|||
let ks = KeySource srcfile srcfile Nothing
|
||||
v <- genKey ks backend
|
||||
case v of
|
||||
Just (k, _) -> ifM (not . null <$> keyLocations k)
|
||||
Just (k, _) -> ifM (isKnownKey k)
|
||||
( return (maybe Nothing (\a -> Just (a k)) dupa)
|
||||
, return notdupa
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue