mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327)
* Allow compare page to look up base, head, own-fork, forkbase-of-head Signed-off-by: Andrew Thornton <[email protected]> * as per @guillep2k Signed-off-by: Andrew Thornton <[email protected]> * Update routers/repo/compare.go * as per @guillep2k Signed-off-by: Andrew Thornton <[email protected]> * Rationalise the names a little Signed-off-by: Andrew Thornton <[email protected]> * Rationalise the names a little (2) Signed-off-by: Andrew Thornton <[email protected]> * Fix 500 with fork of fork Signed-off-by: Andrew Thornton <[email protected]> * Prevent 500 on compare different trees Signed-off-by: Andrew Thornton <[email protected]> * dotdotdot is perfectly valid in both usernames and repo names Signed-off-by: Andrew Thornton <[email protected]> * ensure we can set the head and base repos too Signed-off-by: Andrew Thornton <[email protected]> * ensure we can set the head and base repos too (2) Signed-off-by: Andrew Thornton <[email protected]> * fix lint Signed-off-by: Andrew Thornton <[email protected]> * only set headRepo == baseRepo if isSameRepo Signed-off-by: Andrew Thornton <[email protected]>
This commit is contained in:
@@ -529,10 +529,6 @@ func GetCommitFileStatus(repoPath, commitID string) (*CommitFileStatus, error) {
|
||||
|
||||
// GetFullCommitID returns full length (40) of commit ID by given short SHA in a repository.
|
||||
func GetFullCommitID(repoPath, shortID string) (string, error) {
|
||||
if len(shortID) >= 40 {
|
||||
return shortID, nil
|
||||
}
|
||||
|
||||
commitID, err := NewCommand("rev-parse", shortID).RunInDir(repoPath)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "exit status 128") {
|
||||
|
||||
Reference in New Issue
Block a user