MCPcopy Index your code
hub / github.com/rilldata/rill / commitHash

Method commitHash

runtime/drivers/admin/repo_git.go:359–365  ·  view source on GitHub ↗

commitHash returns the current commit hash of the repository. It returns an empty string (without error) when HEAD points to an unborn branch.

(ctx context.Context)

Source from the content-addressed store, hash-verified

357// commitHash returns the current commit hash of the repository.
358// It returns an empty string (without error) when HEAD points to an unborn branch.
359func (r *gitRepo) commitHash(ctx context.Context) (string, error) {
360 hash, err := gitutil.Hash(ctx, r.repoDir, "HEAD")
361 if errors.Is(err, gitutil.ErrRefNotFound) {
362 return "", nil
363 }
364 return hash, err
365}
366
367// commitTimestamp returns the timestamp of the latest commit on the current branch.
368func (r *gitRepo) commitTimestamp(ctx context.Context) (time.Time, error) {

Callers 1

CommitHashMethod · 0.80

Calls 1

HashFunction · 0.92

Tested by

no test coverage detected