You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Error("Git's HomeDir is empty (RepoRootPath is empty), the git module is not initialized correctly, using a temp HomeDir (%s) temporarily", tmpHomeDir)
136
-
returntmpHomeDir
137
-
138
-
// the Fatal will cause some CI failures (root reason is still unknown), need to be investigated more in the future
139
-
// log.Fatal("Can not get Git's HomeDir (RepoRootPath is empty), the setting and git modules are not initialized correctly")
140
+
// strict check, make sure the git module is initialized correctly.
141
+
// attention: when the git module is called in gitea sub-command (serv/hook), the log module is not able to show messages to users.
142
+
// for example: if there is gitea git hook code calling git.NewCommand before git.InitXxx, the integration test won't show the real failure reasons.
143
+
log.Fatal("can not get Git's HomeDir (RepoRootPath is empty), the setting and git modules are not initialized correctly")
144
+
return""
140
145
}
141
146
returnsetting.RepoRootPath
142
147
}
143
148
144
149
// InitSimple initializes git module with a very simple step, no config changes, no global command arguments.
145
150
// This method doesn't change anything to filesystem. At the moment, it is only used by "git serv" sub-command, no data-race
151
+
// However, in integration test, the sub-command function may be called in the current process, so the InitSimple would be called multiple times, too
0 commit comments