1
0
Fork 0
forked from forgejo/forgejo

New UI merge in progress

This commit is contained in:
Unknwon 2014-07-26 00:24:27 -04:00
parent 0a739cf9ac
commit 8dd07c0ddd
199 changed files with 15030 additions and 9325 deletions

27
modules/git/repo.go Normal file
View file

@ -0,0 +1,27 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package git
import (
"path/filepath"
)
// Repository represents a Git repository.
type Repository struct {
Path string
commitCache map[sha1]*Commit
tagCache map[sha1]*Tag
}
// OpenRepository opens the repository at the given path.
func OpenRepository(repoPath string) (*Repository, error) {
repoPath, err := filepath.Abs(repoPath)
if err != nil {
return nil, err
}
return &Repository{Path: repoPath}, nil
}