mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-08 17:08:04 +02:00
Bug fixes (#184)
* Fix gist content when going back to editing * Fix not outputting non-truncated large files for editon/zip download * Allow dashes in usernames * Delete keys associated to deleted user * Fix error message when there is no files in gist * Show if there is not files in gist preview * Fix log parsing for the 11th empty commit
This commit is contained in:
@ -310,21 +310,21 @@ func (gist *Gist) DeleteRepository() error {
|
||||
return git.DeleteRepository(gist.User.Username, gist.Uuid)
|
||||
}
|
||||
|
||||
func (gist *Gist) Files(revision string) ([]*git.File, error) {
|
||||
func (gist *Gist) Files(revision string, truncate bool) ([]*git.File, error) {
|
||||
var files []*git.File
|
||||
filesStr, err := git.GetFilesOfRepository(gist.User.Username, gist.Uuid, revision)
|
||||
if err != nil {
|
||||
// if the revision or the file do not exist
|
||||
|
||||
if exiterr, ok := err.(*exec.ExitError); ok && exiterr.ExitCode() == 128 {
|
||||
return nil, nil
|
||||
return nil, &git.RevisionNotFoundError{}
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, fileStr := range filesStr {
|
||||
file, err := gist.File(revision, fileStr, true)
|
||||
file, err := gist.File(revision, fileStr, truncate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user