-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lunny/remove_num_watches
- Loading branch information
Showing
30 changed files
with
600 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
poetry | ||
|
||
# backend | ||
go_1_22 | ||
gofumpt | ||
sqlite | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package git | ||
|
||
// GetSubModules get all the submodules of current revision git tree | ||
func (c *Commit) GetSubModules() (*ObjectCache[*SubModule], error) { | ||
if c.submoduleCache != nil { | ||
return c.submoduleCache, nil | ||
} | ||
|
||
entry, err := c.GetTreeEntryByPath(".gitmodules") | ||
if err != nil { | ||
if _, ok := err.(ErrNotExist); ok { | ||
return nil, nil | ||
} | ||
return nil, err | ||
} | ||
|
||
rd, err := entry.Blob().DataAsync() | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer rd.Close() | ||
|
||
// at the moment we do not strictly limit the size of the .gitmodules file because some users would have huge .gitmodules files (>1MB) | ||
c.submoduleCache, err = configParseSubModules(rd) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return c.submoduleCache, nil | ||
} | ||
|
||
// GetSubModule get the submodule according entry name | ||
func (c *Commit) GetSubModule(entryName string) (*SubModule, error) { | ||
modules, err := c.GetSubModules() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if modules != nil { | ||
if module, has := modules.Get(entryName); has { | ||
return module, nil | ||
} | ||
} | ||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,7 @@ author KN4CK3R <[email protected]> 1711702962 +0100 | |
committer KN4CK3R <[email protected]> 1711702962 +0100 | ||
encoding ISO-8859-1 | ||
gpgsig -----BEGIN PGP SIGNATURE----- | ||
<SPACE> | ||
iQGzBAABCgAdFiEE9HRrbqvYxPT8PXbefPSEkrowAa8FAmYGg7IACgkQfPSEkrow | ||
Aa9olwv+P0HhtCM6CRvlUmPaqswRsDPNR4i66xyXGiSxdI9V5oJL7HLiQIM7KrFR | ||
gizKa2COiGtugv8fE+TKqXKaJx6uJUJEjaBd8E9Af9PrAzjWj+A84lU6/PgPS8hq | ||
|
@@ -150,7 +150,7 @@ gpgsig -----BEGIN PGP SIGNATURE----- | |
-----END PGP SIGNATURE----- | ||
ISO-8859-1` | ||
|
||
commitString = strings.ReplaceAll(commitString, "<SPACE>", " ") | ||
sha := &Sha1Hash{0xfe, 0xaf, 0x4b, 0xa6, 0xbc, 0x63, 0x5f, 0xec, 0x44, 0x2f, 0x46, 0xdd, 0xd4, 0x51, 0x24, 0x16, 0xec, 0x43, 0xc2, 0xc2} | ||
gitRepo, err := openRepositoryWithDefaultContext(filepath.Join(testReposDir, "repo1_bare")) | ||
assert.NoError(t, err) | ||
|
Oops, something went wrong.