diff options
Diffstat (limited to 'refs.update.go')
| -rw-r--r-- | refs.update.go | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/refs.update.go b/refs.update.go deleted file mode 100644 index f103417..0000000 --- a/refs.update.go +++ /dev/null @@ -1,55 +0,0 @@ -package gitpb - -/* -// Update repo.Refs from .git/ -func (repo *Repo) UpdateGit() error { - // delete the old hash - // r.DeleteByHash(hash) - repo.Refs = nil - - tags := []string{"%(objectname)", "%(creatordate)", "%(*authordate)", "%(refname)", "%(subject)"} - format := strings.Join(tags, "_,,,_") - cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format", format} - // log.Info("RUNNING:", strings.Join(cmd, " ")) - result := shell.PathRunQuiet(repo.FullPath, cmd) - if result.Error != nil { - log.Warn("git for-each-ref error:", result.Error) - return result.Error - } - - lines := result.Stdout - // reverse the git order - slices.Reverse(lines) - - var refName string - var hash string - var subject string - var ctime time.Time - - for i, line := range lines { - var parts []string - parts = make([]string, 0) - parts = strings.Split(line, "_,,,_") - if len(parts) != 5 { - log.Info("tag error:", i, parts) - continue - } - refName = parts[3] - hash = parts[0] - - ctime = getGitDateStamp(parts[1]) - - subject = parts[4] - } - - newr := Ref{ - Hash: hash, - Subject: subject, - RefName: refName, - Ctime: timestamppb.New(ctime), - } - - repo.AppendRef(&newr) - return nil -} -*/ |
