mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 05:25:15 +01:00 
			
		
		
		
	unset XDG_HOME_CONFIG as gitea manages configuration locations (#33067)
unset XDG_CONFIG_HOME early to enable gitea to manage git configuration. simple error checking to satisfy the linting. Closes #33039 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		
							parent
							
								
									c1167709ed
								
							
						
					
					
						commit
						233b7959e0
					
				@ -165,6 +165,7 @@ func NewMainApp(appVer AppVersion) *cli.App {
 | 
				
			|||||||
	app.Commands = append(app.Commands, subCmdWithConfig...)
 | 
						app.Commands = append(app.Commands, subCmdWithConfig...)
 | 
				
			||||||
	app.Commands = append(app.Commands, subCmdStandalone...)
 | 
						app.Commands = append(app.Commands, subCmdStandalone...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						setting.InitGiteaEnvVars()
 | 
				
			||||||
	return app
 | 
						return app
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -59,6 +59,7 @@ func InitSettings() {
 | 
				
			|||||||
	_ = hash.Register("dummy", hash.NewDummyHasher)
 | 
						_ = hash.Register("dummy", hash.NewDummyHasher)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setting.PasswordHashAlgo, _ = hash.SetDefaultPasswordHashAlgorithm("dummy")
 | 
						setting.PasswordHashAlgo, _ = hash.SetDefaultPasswordHashAlgorithm("dummy")
 | 
				
			||||||
 | 
						setting.InitGiteaEnvVars()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// TestOptions represents test options
 | 
					// TestOptions represents test options
 | 
				
			||||||
 | 
				
			|||||||
@ -166,3 +166,8 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	return changed
 | 
						return changed
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// InitGiteaEnvVars initilises the environment for gitea
 | 
				
			||||||
 | 
					func InitGiteaEnvVars() {
 | 
				
			||||||
 | 
						_ = os.Unsetenv("XDG_CONFIG_HOME") // unset if set as HOME is managed by gitea
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user