git-annex-shell: Don't let configlist auto-init repository when in readonly mode.
This was potentially a hole in the readonly mode armor even before my last commit. If the user could push a git-annex branch to a repo, they could get git-annex-shell to initialize the repo. After my last commit, the user didn't even need to be allowed to push a branch to init the repo, so this hole certianly needs to be closed now.
This commit is contained in:
parent
c5b8484c2e
commit
367d1352da
4 changed files with 74 additions and 60 deletions
|
@ -15,6 +15,7 @@ import qualified Annex.Branch
|
|||
import qualified Git.Config
|
||||
import Remote.GCrypt (coreGCryptId)
|
||||
import qualified CmdLine.GitAnnexShell.Fields as Fields
|
||||
import CmdLine.GitAnnexShell.Checks
|
||||
|
||||
cmd :: Command
|
||||
cmd = noCommit $ dontCheck repoExists $
|
||||
|
@ -44,6 +45,7 @@ findOrGenUUID = do
|
|||
then return u
|
||||
else ifM (Annex.Branch.hasSibling <||> (isJust <$> Fields.getField Fields.autoInit))
|
||||
( do
|
||||
liftIO checkNotReadOnly
|
||||
initialize Nothing
|
||||
getUUID
|
||||
, return NoUUID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue