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
* giteaofficial/main:
Make "sync branch" also sync object format and add tests (go-gitea#30878)
Make sure git version&feature are always prepared (go-gitea#30877)
Get repo list with OrderBy alpha should respect owner too (go-gitea#30784)
Fix some UI problems (dropdown/container) (go-gitea#30849)
Fix some UI problems (install/checkbox) (go-gitea#30854)
// ius.io is the recommended official(git-scm.com) method to install git
104
119
moreHint="get git: https://git-scm.com/download/linux and https://ius.io"
105
120
}
106
121
}
107
-
returnfmt.Errorf("installed git version %q is not supported, Gitea requires git version >= %q, %s", DefaultFeatures.GitVersion.Original(), RequiredVersion, moreHint)
122
+
returnfmt.Errorf("installed git version %q is not supported, Gitea requires git version >= %q, %s", DefaultFeatures().gitVersion.Original(), RequiredVersion, moreHint)
returnfmt.Errorf("installed git version %s has a known compatibility issue with Gitea: %w, please upgrade (or downgrade) git", DefaultFeatures.GitVersion.String(), err)
returnfmt.Errorf("installed git version %s has a known compatibility issue with Gitea: %w, please upgrade (or downgrade) git", DefaultFeatures().gitVersion.String(), err)
138
127
}
139
128
returnnil
140
129
}
@@ -154,8 +143,12 @@ func HomeDir() string {
154
143
// InitSimple initializes git module with a very simple step, no config changes, no global command arguments.
155
144
// This method doesn't change anything to filesystem. At the moment, it is only used by some Gitea sub-commands.
156
145
funcInitSimple(ctx context.Context) error {
157
-
iferr:=checkInit(); err!=nil {
158
-
returnerr
146
+
ifsetting.Git.HomePath=="" {
147
+
returnerrors.New("unable to init Git's HomeDir, incorrect initialization of the setting and git modules")
// InitFull initializes git module with version check and change global variables, sync gitconfig.
172
-
// It should only be called once at the beginning of the program initialization (TestMain/GlobalInitInstalled) as this code makes unsynchronized changes to variables.
173
-
funcInitFull(ctx context.Context) (errerror) {
174
-
iferr=InitSimple(ctx); err!=nil {
165
+
varerrerror
166
+
defaultFeatures, err=loadGitVersionFeatures()
167
+
iferr!=nil {
168
+
returnerr
169
+
}
170
+
iferr=ensureGitVersion(); err!=nil {
175
171
returnerr
176
172
}
177
173
178
174
// when git works with gnupg (commit signing), there should be a stable home for gnupg commands
// InitFull initializes git module with version check and change global variables, sync gitconfig.
182
+
// It should only be called once at the beginning of the program initialization (TestMain/GlobalInitInstalled) as this code makes unsynchronized changes to variables.
183
+
funcInitFull(ctx context.Context) (errerror) {
184
+
iferr=InitSimple(ctx); err!=nil {
185
+
returnerr
186
+
}
182
187
183
188
// Since git wire protocol has been released from git v2.18
0 commit comments