Fix a minor bug that caused options provided with -c to be passed multiple times to git.
This commit is contained in:
		
					parent
					
						
							
								b166223d48
							
						
					
				
			
			
				commit
				
					
						c8fec6ab03
					
				
			
		
					 4 changed files with 19 additions and 3 deletions
				
			
		
							
								
								
									
										6
									
								
								Annex.hs
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								Annex.hs
									
										
									
									
									
								
							|  | @ -325,7 +325,11 @@ overrideGitConfig f = changeState $ \s -> s | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| {- Adds an adjustment to the Repo data. Adjustments persist across reloads | {- Adds an adjustment to the Repo data. Adjustments persist across reloads | ||||||
|  - of the repo's config. -} |  - of the repo's config. | ||||||
|  |  - | ||||||
|  |  - Note that the action may run more than once, and should avoid eg, | ||||||
|  |  - appending the same value to a repo's config when run repeatedly. | ||||||
|  |  -} | ||||||
| adjustGitRepo :: (Git.Repo -> IO Git.Repo) -> Annex () | adjustGitRepo :: (Git.Repo -> IO Git.Repo) -> Annex () | ||||||
| adjustGitRepo a = do | adjustGitRepo a = do | ||||||
| 	changeState $ \s -> s { repoadjustment = \r -> repoadjustment s r >>= a } | 	changeState $ \s -> s { repoadjustment = \r -> repoadjustment s r >>= a } | ||||||
|  |  | ||||||
|  | @ -1,3 +1,10 @@ | ||||||
|  | git-annex (8.20200310) UNRELEASED; urgency=medium | ||||||
|  | 
 | ||||||
|  |   * Fix a minor bug that caused options provided with -c to be passed | ||||||
|  |     multiple times to git. | ||||||
|  | 
 | ||||||
|  |  -- Joey Hess <id@joeyh.name>  Mon, 16 Mar 2020 12:43:33 -0400 | ||||||
|  | 
 | ||||||
| git-annex (8.20200309) upstream; urgency=medium | git-annex (8.20200309) upstream; urgency=medium | ||||||
| 
 | 
 | ||||||
|   * Fix bug that caused unlocked annexed dotfiles to be added to git by the |   * Fix bug that caused unlocked annexed dotfiles to be added to git by the | ||||||
|  |  | ||||||
|  | @ -93,7 +93,10 @@ gitAnnexGlobalOptions = commonGlobalOptions ++ | ||||||
|   where |   where | ||||||
| 	setnumcopies n = Annex.changeState $ \s -> s { Annex.forcenumcopies = Just $ NumCopies n } | 	setnumcopies n = Annex.changeState $ \s -> s { Annex.forcenumcopies = Just $ NumCopies n } | ||||||
| 	setuseragent v = Annex.changeState $ \s -> s { Annex.useragent = Just v } | 	setuseragent v = Annex.changeState $ \s -> s { Annex.useragent = Just v } | ||||||
| 	setgitconfig v = Annex.adjustGitRepo $ \r -> Git.Config.store (encodeBS' v) $  | 	setgitconfig v = Annex.adjustGitRepo $ \r ->  | ||||||
|  | 		if Param v `elem` gitGlobalOpts r | ||||||
|  | 			then return r | ||||||
|  | 			else Git.Config.store (encodeBS' v) $  | ||||||
| 				r { gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param v] } | 				r { gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param v] } | ||||||
| 	setdesktopnotify v = Annex.changeState $ \s -> s { Annex.desktopnotify = Annex.desktopnotify s <> v } | 	setdesktopnotify v = Annex.changeState $ \s -> s { Annex.desktopnotify = Annex.desktopnotify s <> v } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -37,3 +37,5 @@ worth filing in case there's a simple fix. | ||||||
| 
 | 
 | ||||||
| [[!meta author=kyle]] | [[!meta author=kyle]] | ||||||
| [[!tag projects/datalad]] | [[!tag projects/datalad]] | ||||||
|  | 
 | ||||||
|  | > [[fixed|done]] --[[Joey]] | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joey Hess
				Joey Hess