If an intermediate tree already exists and we know this ahead of time,
we should use it without recreating it with all of its contents resolved
and written recursively. This commit adds support for such cases and
renames TreeBuilder's APIs to generalize away from accepting blob IDs
only.
Signed-off-by: Aditya Sirish <aditya@saky.in>
This commit adds a uint64 Number field to RSL entries. This allows us to
determine the ordering of distinct RSL entries, enabling optimizations
such as knowing which policy to use for an entry without always walking
the RSL.
The implementation maintains backwards compatibility, so the numbering
can start from whenever this is enabled. This is made easy by the fact
that we can guarantee gittuf is updated everywhere it is currently used.
Signed-off-by: Aditya Sirish <aditya@saky.in>
- Make CreateCommitObject support merge commits, with multiple parent
hashes
- Changed other files to use an array of parent hashes instead of a
single hash
- By changing the parameters for CreateCommitObject, internal/common had
errors that had to be fixed.
Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
This removes the sub-go.mod in favor of updating all references to the
third_party/go-git package.
This lets users `go install` from outside of the module.
Signed-off-by: Billy Lynch <billy@chainguard.dev>
Rename EntryType to Entry for a better generic term. This avoids a
collision with the actual rsl.Entry type. The old Entry type is now
named ReferenceEntry and the Annotation type is AnnotationEntry.
Signed-off-by: Aditya Sirish <aditya@saky.in>
In addition to gittuf verify-tag workflows, this commit fixes the RSL to
be more generic. An RSL entry no longer exclusively requires a commit
ID.
Signed-off-by: Aditya Sirish <aditya@saky.in>
rsl.RSLRef is now just rsl.Ref to avoid the repetition. Also,
RSLRemoteTrackerRef is no longer a constant, replaced by
rsl.RemoteTrackerRef() which returns a substituted tracker string for
the specified remote.
Signed-off-by: Aditya Sirish <aditya@saky.in>
1. Commit now returns the ID of the newly created commit. This will help
us avoid extraneous calls to repo.Reference to get the new state of
the affected ref.
2. Commit also creates the ref if it doesn't already exist. This allows
to skip initializing (to zero) refs we're about to commit to anyway.
Note: this commit does not actually remove those extra
initializations. That is left to a future patch or clean up pass.
Signed-off-by: Aditya Sirish <aditya@saky.in>
As part of this commit, some test helper code is reorganized to avoid repetition in
repository and policy.
Signed-off-by: Aditya Sirish <aditya@saky.in>