#74 Remove cached plaintext of secret files on uninstall or flush
#74 Remove cached plaintext of secret files on uninstall or flush

When transcrypt is uninstalled or credentials are flushed, remove
plaintext data about secret files cached due to the `cachetextconv`
setting by:

- use `update-ref` command to delete Git's notes ref to the cached
  data (stored as a pseudo-"commit" object in my testing)
- run 'prune' to delete all unreachable objects from the Git database,
  especially the now-unreachable cached data object.

See gitattributes section "Performing text diffs of binary files" [1]:

> If you want to invalidate the cache manually [...] you can remove
> the cache manually with `git update-ref -d refs/notes/textconv/jpg`
> (where "jpg" is the name of the diff driver, as in the example above).

Note that just removing the ref is insufficient to immediately remove
the object from Git's DB, hence the explicit `git prune` step.

[1]: https://git-scm.com/docs/gitattributes#_performing_text_diffs_of_binary_files

elasticdog/transcrypt