drop, move, mirror: when two files have the same content, honor the max numcopies...
authorJoey Hess <joeyh@joeyh.name>
Tue, 15 Jun 2021 15:38:44 +0000 (11:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 15 Jun 2021 15:38:44 +0000 (11:38 -0400)
commitd2be68907c59c43ab59c4994021fe134bd373b18
treefdc03331e51d81f1d50b069b55ebf2617f8256db
parent0ed1369dcdd3a55e807dccca979d1c679189082d
drop, move, mirror: when two files have the same content, honor the max numcopies and requiredcopies

Eg, before with a .gitattributes like:

*.2 annex.numcopies=2
*.1 annex.numcopies=1

And foo.1 and foo.2 having the same content and key, git-annex drop foo.1 foo.2
would succeed, leaving just 1 copy, despite foo.2 needing 2 copies.
It dropped foo.1 first and then skipped foo.2 since its content was gone.

Now that the keys database includes locked files, this longstanding wart
can be fixed.

Sponsored-by: Noam Kremen on Patreon
Annex/Drop.hs
Annex/NumCopies.hs
CHANGELOG
Command/Drop.hs
Command/Mirror.hs
Command/Move.hs
doc/todo/numcopies_check_other_files_using_same_key.mdwn