diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-15 23:38:11 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-15 23:38:11 +0800 |
commit | 6bdd6f9b18136a6066f3fc87349037027eb7a499 (patch) | |
tree | 8772e0111fd83abf6abef36796a68166e7a49b38 /models/repo.go | |
parent | 2acf54b53b9be5cbd014f7af02e543a359e7f8f4 (diff) | |
download | gitea-6bdd6f9b18136a6066f3fc87349037027eb7a499.tar.gz gitea-6bdd6f9b18136a6066f3fc87349037027eb7a499.zip |
add size for file
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/models/repo.go b/models/repo.go index c52d0a1f24..125abfc342 100644 --- a/models/repo.go +++ b/models/repo.go @@ -261,69 +261,6 @@ func GetRepositoryCount(user *User) (int64, error) { return orm.Count(&Repository{OwnerId: user.Id}) } -/* -type RepoFile struct { - Id *git.Oid - Type int - Name string - Path string - Message string - Created time.Time -} - -func (f *RepoFile) IsFile() bool { - return f.Type == git.FilemodeBlob || f.Type == git.FilemodeBlobExecutable -} - -func (f *RepoFile) IsDir() bool { - return f.Type == git.FilemodeTree -}*/ - -/* -func GetReposFiles(userName, reposName, branchName, rpath string) ([]*RepoFile, error) { - f := RepoPath(userName, reposName) - - repo, err := git.OpenRepository(f) - if err != nil { - return nil, err - } - - repo.LookupReference("refs/heads/" + branchName) - - obj, err := repo.RevparseSingle("HEAD") - if err != nil { - return nil, err - } - lastCommit := obj.(*git.Commit) - var repofiles []*RepoFile - tree, err := lastCommit.Tree() - if err != nil { - return nil, err - } - //var i uint64 = 0 - if rpath != "" { - rpath = rpath + "/" - } - //fmt.Println("...", rpath, "...") - - tree.Walk(func(dirname string, entry *git.TreeEntry) int { - if dirname == rpath { - //fmt.Println("====", dirname, "==", entry.Name) - repofiles = append(repofiles, &RepoFile{ - entry.Id, - entry.Filemode, - entry.Name, - path.Join(dirname, entry.Name), - lastCommit.Message(), - lastCommit.Committer().When, - }) - } - return 0 - }) - - return repofiles, nil -}*/ - func StarReposiory(user *User, repoName string) error { return nil } |