Commit graph

138 commits

Author SHA1 Message Date
Pat Zielinski
b561471d87 gitinterface: Add changes tests
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-06-06 12:24:16 -04:00
Pat Zielinski
adca246743 gitinterface: Add log tests
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-06-06 11:34:21 -04:00
Aditya Sirish
140d7e55ad
gitinterface: Add utils funcs
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-06-05 18:24:19 -04:00
Aditya Sirish
fb5186d54f
gitinterface: Add change and config management
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-06-05 18:24:18 -04:00
Aditya Sirish
7b89349a0c
gitinterface: Add sync methods
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-06-05 18:16:20 -04:00
Aditya Sirish
46fb47fdcc
gitinterface: Test for custom references
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-30 08:41:21 +05:30
Aditya Sirish
c9f00e1615
gitinterface: Set env vars for cmd in execute APIs
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-30 08:22:49 +05:30
Aditya Sirish
a0e62aa8b7
gitinterface: RSA keys in tests for Windows compat
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-28 15:47:54 +05:30
Aditya Sirish
5e0f7ea5df
gitinterface: Use public key for user.signingkey
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:59:40 +05:30
Aditya Sirish
1831da4b4a
gitinterface: Add generic signature flow
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:39:20 +05:30
Aditya Sirish
e95723d6f5
gitinterface: Add references
Also updates an expected error return in policy.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:39:19 +05:30
Aditya Sirish
aae8e0cbdf
gitinterface: Add commits and tags
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:39:19 +05:30
Aditya Sirish
cd8dcc4a3f
gitinterface: Add support for trees
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:39:19 +05:30
Aditya Sirish
cac885b9ac
gitinterface: Verify stdin is not nil
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-22 23:38:58 +05:30
Aditya Sirish
b5a1386f99
gitinterface: Add support for blobs
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-17 17:22:50 -04:00
Aditya Sirish
ce5d52a094
gitinterface: Add execution helpers with stdin
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-17 17:22:48 -04:00
Pat Zielinski
73197afe0a gitinterface: Fix test failing on Windows
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-05-17 16:17:40 -04:00
Aditya Sirish
7cfdd01659
gitinterface: Expose test helpers
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-08 11:58:29 -04:00
Aditya Sirish
228de1daf1
gitinterface: Git config support
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-08 11:58:29 -04:00
Aditya Sirish
c92dbeaa4f
gitinterface: Add representation of a repository
This commit introduces gittuf's custom representation of a Git
repository. In addition, it introduces notion of a Hash type to
represent a Git ID. This can be either SHA-1 or SHA-256.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-08 11:58:29 -04:00
Aditya Sirish
d4ee65ce67
gitinterface: Handle zero commit in GetMergeTree
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-04-15 13:10:25 -04:00
Aditya Sirish
4d2fed23e2
*: Switch authorizations to use merge tree target
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-04-10 15:21:34 -04:00
Aditya Sirish
279533c056
gitinterface: Make user.signingkey optional
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-04-09 17:10:31 -04:00
Aditya Sirish
e65e9cf394
gitinterface: Remove unused parameter
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-02-09 11:00:19 -05:00
Ghanshyam Thakkar
0e3afe6dbb
clone: display progress on Stdout
Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
2024-02-02 12:45:56 +05:30
Aditya Sirish
f940551271
*: Rename eval to developer mode
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-16 11:18:50 -05:00
Aditya Sirish
03159de27f
*: Centralize test artifacts
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-15 00:23:47 -05:00
Aditya Sirish
33af1b8887
signerverifier: Support legacy private key format
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-15 00:23:47 -05:00
Aditya Sirish
3397ac9bad
*: Vendor go-sslib with new signerverifier flows
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-15 00:22:53 -05:00
Aditya Sirish
e6a2ca788a
gitinterface: Support generic PEM header
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-11 16:37:41 -05:00
Aditya Sirish
4cbfa95bc8
gitinterface: Support Git signing with specific keys
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-10 19:00:43 -05:00
Aditya Sirish
1ab613b589
gitinterface: Update SSH signature verification
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-09 13:49:11 -05:00
Billy Lynch
52e3bb4336
Merge pull request #253 from gittuf/ssh-signatures
gitinterface: Support verifying SSH key signatures
2024-01-09 11:26:26 -05:00
Aditya Sirish
588a31e025
gitinterface: Support verifying SSH key signatures
Also updates error chaining in signature verification to preserve error
context, making debugging easier.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-09 11:20:27 -05:00
Aditya Sirish
a2671464de
gitinterface: Support empty trees in TreeBuilder
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-03 11:11:03 -05:00
neilnaveen
a1095c6e13 Clarify TODO for GetCommitsBetweenRange
- Clarified TODO for GetCommitsBetweenRange, passing the commit id's in
  reverse order should change the result of the function.

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2023-11-30 11:25:35 -06:00
Aditya Sirish
2fd0988424
dep: Remove vendored copy of go-git
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-29 21:04:54 +05:30
Aditya Sirish
10d8330126
gitinterface: Get all blob paths and IDs in tree
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-21 16:49:01 +05:30
neilnaveen
d626318993 Created test in log.go for merge commits
- Created test with a git tree containing a merge commit
- Added additional edge cases for regular git tree

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2023-11-20 12:08:10 -05:00
Aditya Sirish
1ba91e0dc7
Merge pull request #172 from neilnaveen/neil/internal/gitinterface/changes.go
Handle Merge Commit in GetFilePathsChangedByCommit
2023-11-12 14:26:34 -05:00
neilnaveen
8692f7a684 Handle Merge Commit in GetFilePathsChangedByCommit
- Changed handling of merge commits to check if one of the parent commits
  matches the current commit. If not we return the sorted diffs between
  the current commit and all parent commits.

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2023-11-11 19:23:08 -06:00
Billy Lynch
acd5a18eb1
Fix lint issues.
Signed-off-by: Billy Lynch <billy@chainguard.dev>
2023-11-09 18:22:10 -05:00
neilnaveen
40ed92a52d Make CreateCommitObject Support Merge Commits
- 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>
2023-11-06 15:55:59 -06:00
Aditya Sirish
1d724fb749
gitinterface: Fix var names
Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-02 16:05:36 -04:00
Billy Lynch
454e21c65d
Merge pull request #157 from gittuf/get-objects-from-gitinterface
*: Route GetObject requests through gitinterface
2023-11-02 14:50:42 -04:00
Aditya Sirish
98204f117d
Merge pull request #165 from gittuf/add-tree-builder
gitinterface: Add TreeBuilder
2023-11-02 14:48:09 -04:00
neilnaveen
c72c4a6fc6 Double Initial Capacity of reSpecs Slice in Fetch
- Double initial capacity of reSpecs slice in Fetch for higher efficiency in
  append operations

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2023-11-01 16:24:53 -05:00
Aditya Sirish
2e89a841dd
gitinterface: Add TreeBuilder
TreeBuilder allows for adding multiple files (with their blob IDs) to a
tree, creating intermediate trees on the fly based on the files' paths.

This is based significantly off "buildTreeHelper" in go-git. It's
possible this will eventually be upstreamed to go-git in plumbing and
used in "buildTreeHelper".

cc @pjbgf

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-11-01 12:15:28 -04:00
Aditya Sirish
0541411fc1
*: Route GetObject requests through gitinterface
This allows us to perform additional checks in future such as whether an
object is replaced by a replace ref. It also makes it easier to switch
between go-git and another mechanism to invoke Git, such as directly
using the binary.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2023-10-26 11:13:32 -04:00
Billy Lynch
d57191618a
Remove module replace in favor of a package fork.
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>
2023-10-25 19:25:56 -04:00