Commit Graph

1 Commits

Author SHA1 Message Date
brian m. carlson
b53c8b27b6
git: provide a read-only configuration object
There are some cases, notably in tests, where we do not want to write to
the filesystem.  In such cases, it's better to return an error and let
each call site determine whether or not that error should be fatal.

Add a NewReadOnlyConfig constructor that works the same way as the
existing constructor, but simply sets a flag to block any writes.  Make
the functions that write to the filesystem go through a wrapper that
checks for read-only status and have them fail.
2018-10-26 15:27:54 +00:00