gittuf/pkg/gitinterface
lakshit verma a4cbba9b15
gitinterface: placate gosec taint analysis on worktree path reads
golangci-lint (gosec G703) flags the worktree and commondir path reads as
path traversal because it cannot see across the validation functions. Each
resolved path is constrained before use: it must point into an existing
directory that is not the repository's GIT_DIR, and for linked worktrees
the .git entry must in turn reference this repository. Annotate the read
sites to reflect that these are trusted repository-local paths.

Also fix test-only lints from the CI gate: use 0600 file permissions for
temporary files and mark TestGetWorktree parallel at the top level.

Signed-off-by: lakshit verma <vermalucky2004@gmail.com>
2026-08-24 19:50:38 +05:30
..
blob.go
blob_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30
changes.go
changes_test.go pkg/gitinterface: Add and refactor tests for coverage 2026-04-30 02:47:33 +05:30
commit.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
commit_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
common.go feat(sha256): support SHA-256 object format 2026-07-16 23:03:18 +01:00
common_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
config.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
config_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
hash.go refactor: standardize on githash.Hash 2026-08-03 21:27:52 +01:00
hash_test.go
log.go
log_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
object.go
object_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30
README.md
references.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
references_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
remote.go
remote_test.go
replace_ref_test.go gitinterface: ignore refs/replace/ in git invocations 2026-07-24 09:51:15 +01:00
repository.go gitinterface: placate gosec taint analysis on worktree path reads 2026-08-24 19:50:38 +05:30
repository_test.go gitinterface: resolve worktrees for detached git dirs and worktrees 2026-08-24 16:16:00 +05:30
signature.go deps: Bump gitsign 2026-08-17 15:16:10 -07:00
signature_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
status.go gitinterface: resolve worktrees for detached git dirs and worktrees 2026-08-24 16:16:00 +05:30
status_test.go Merge pull request #1273 from ayuxsh009/fix/status-rename-parser 2026-04-29 20:24:55 +00:00
sync.go Block use of extensions.compatObjectFormat 2026-07-16 23:03:24 +01:00
sync_test.go feat(sha256): support SHA-256 object format 2026-07-16 23:03:18 +01:00
tag.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
tag_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
tree.go gitinterface: harden worktree resolution against stale or hostile records 2026-08-24 17:28:19 +05:30
tree_test.go Introduce gitstore.Storer and make gittuf's core dependency-light 2026-08-03 21:27:49 +01:00
utils.go gitinterface: resolve worktrees for detached git dirs and worktrees 2026-08-24 16:16:00 +05:30
utils_test.go test: improve pkg/gitinterface coverage from 69.4% to 76.2% 2026-04-25 02:44:19 +05:30
worktree_test.go gitinterface: placate gosec taint analysis on worktree path reads 2026-08-24 19:50:38 +05:30

gittuf's gitinterface Package

gittuf's gitinterface package is a lightweight Go API for interacting with Git repositories. It is similar to go-git in its goal, but differs as, unlike go-git, gitinterface uses the Git binary for its operations.

To operate correctly, gitinterface requires a Git binary version of 2.34 or higher.