Behavior change: --trust option no longer overrides trust
Since that can lead to data loss, which should never be enabled by an option other than --force. I suppose that using --trust was in some situation, safer than --force, because it doesn't entirely disable checking for data loss, but only disables checking involving data that is on the specified repository. But it seems better to be able to say that data loss only happens with --force. This commit was sponsored by Graham Spencer on Patreon.
This commit is contained in:
		
					parent
					
						
							
								6a0030a110
							
						
					
				
			
			
				commit
				
					
						2bf34fc17f
					
				
			
		
					 5 changed files with 14 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -384,8 +384,10 @@ listRemoteNames remotes = intercalate ", " (map name remotes)
 | 
			
		|||
forceTrust :: TrustLevel -> String -> Annex ()
 | 
			
		||||
forceTrust level remotename = do
 | 
			
		||||
	u <- nameToUUID remotename
 | 
			
		||||
	Annex.changeState $ \s ->
 | 
			
		||||
		s { Annex.forcetrust = M.insert u level (Annex.forcetrust s) }
 | 
			
		||||
	if level >= Trusted
 | 
			
		||||
		then toplevelWarning False "Ignoring request to trust repository, because that can lead to data loss."
 | 
			
		||||
		else Annex.changeState $ \s ->
 | 
			
		||||
			s { Annex.forcetrust = M.insert u level (Annex.forcetrust s) }
 | 
			
		||||
 | 
			
		||||
{- Used to log a change in a remote's having a key. The change is logged
 | 
			
		||||
 - in the local repo, not on the remote. The process of transferring the
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue