git-annex unused --from remote skips its git-remote-annex keys
This turns out to only be necessary is edge cases. Most of the time, git-annex unused --from remote doesn't see git-remote-annex keys at all, because it does not record a location log for them. On the other hand, git-annex unused does find them, since it does not rely on the location log. And that's good because they're a local cache that the user should be able to drop. If, however, the user ran git-annex unused and then git-annex move --unused --to remote, the keys would have a location log for that remote. Then git-annex unused --from remote would see them, and would consider them unused. Even when they are present on the special remote they belong to. And that risks losing data if they drop the keys from the special remote, but didn't expect it would delete git branches they had pushed to it. So, make git-annex unused --from skip git-remote-annex keys whose uuid is the same as the remote.
This commit is contained in:
parent
0bf72ef103
commit
24af51e66d
4 changed files with 37 additions and 9 deletions
|
@ -220,6 +220,7 @@ data KeyVariety
|
|||
| URLKey
|
||||
| VURLKey
|
||||
| GitBundleKey
|
||||
| GitManifestKey
|
||||
-- A key that is handled by some external backend.
|
||||
| ExternalKey S.ByteString HasExt
|
||||
-- Some repositories may contain keys of other varieties,
|
||||
|
@ -255,6 +256,7 @@ hasExt WORMKey = False
|
|||
hasExt URLKey = False
|
||||
hasExt VURLKey = False
|
||||
hasExt GitBundleKey = False
|
||||
hasExt GitManifestKey = False
|
||||
hasExt (ExternalKey _ (HasExt b)) = b
|
||||
hasExt (OtherKey s) = (snd <$> S8.unsnoc s) == Just 'E'
|
||||
|
||||
|
@ -285,6 +287,7 @@ formatKeyVariety v = case v of
|
|||
URLKey -> "URL"
|
||||
VURLKey -> "VURL"
|
||||
GitBundleKey -> "GITBUNDLE"
|
||||
GitManifestKey -> "GITMANIFEST"
|
||||
ExternalKey s e -> adde e ("X" <> s)
|
||||
OtherKey s -> s
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue