fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

all: use git >= 2.38.5 (#580)

This is to resolve CVE-2023-25652 and CVE-2023-29007.

Additionally we update the gitindex tests to specify the default branch
to use. This was to fix local failures I was experiencing.

Test Plan: go test inside of nix develop. Additionally ensure the
version of git was larger than 2.38.5 when testing.

+10 -10
+1 -1
Dockerfile.indexserver
··· 1 1 FROM alpine:3.17.3 2 2 3 3 RUN apk update --no-cache && apk upgrade --no-cache && \ 4 - apk add --no-cache ca-certificates bind-tools tini git jansson && \ 4 + apk add --no-cache ca-certificates bind-tools tini 'git>=2.38.5-r0' jansson && \ 5 5 apk add --upgrade --no-cache 'libcrypto1.1>=1.1.1n-r0' 'libssl1.1>=1.1.1n-r0' 'pcre2>=10.40-r0' 'e2fsprogs>=1.46.6-r0' 6 6 # Run as non-root user sourcegraph. External volumes should be mounted under /data (which will be owned by sourcegraph). 7 7 RUN mkdir -p /home/sourcegraph
+3 -3
flake.lock
··· 2 2 "nodes": { 3 3 "nixpkgs": { 4 4 "locked": { 5 - "lastModified": 1676110339, 6 - "narHash": "sha256-kOS/L8OOL2odpCOM11IevfHxcUeE0vnZUQ74EOiwXcs=", 5 + "lastModified": 1682879489, 6 + "narHash": "sha256-sASwo8gBt7JDnOOstnps90K1wxmVfyhsTPPNTGBPjjg=", 7 7 "owner": "NixOS", 8 8 "repo": "nixpkgs", 9 - "rev": "e5530aba13caff5a4f41713f1265b754dc2abfd8", 9 + "rev": "da45bf6ec7bbcc5d1e14d3795c025199f28e0de0", 10 10 "type": "github" 11 11 }, 12 12 "original": {
+1 -1
gitindex/clone_test.go
··· 26 26 27 27 script := `mkdir orig 28 28 cd orig 29 - git init 29 + git init -b master 30 30 cd .. 31 31 git clone orig/.git clone.git 32 32 `
+2 -2
gitindex/ignore_test.go
··· 22 22 } 23 23 script := `mkdir repo 24 24 cd repo 25 - git init 25 + git init -b master 26 26 mkdir subdir 27 27 echo acont > afile 28 28 echo sub-cont > subdir/sub-file ··· 35 35 36 36 mkdir .sourcegraph 37 37 echo subdir/ > .sourcegraph/ignore 38 - git add .sourcegraph/ignore 38 + git add .sourcegraph/ignore 39 39 git commit -am "ignore subdir/" 40 40 41 41 git update-ref refs/meta/config HEAD
+1 -1
gitindex/index.go
··· 415 415 continue 416 416 } 417 417 418 - return fmt.Errorf("getCommit: %w", err) 418 + return fmt.Errorf("getCommit(%q, %q): %w", opts.BranchPrefix, b, err) 419 419 } 420 420 421 421 opts.BuildOptions.RepositoryDescription.Branches = append(opts.BuildOptions.RepositoryDescription.Branches, zoekt.RepositoryBranch{
+1 -1
gitindex/index_test.go
··· 526 526 repositoryDir := t.TempDir() 527 527 528 528 // setup: initialize the repository and all of its branches 529 - runScript(t, repositoryDir, "git init") 529 + runScript(t, repositoryDir, "git init -b master") 530 530 runScript(t, repositoryDir, fmt.Sprintf("git config user.email %q", "you@example.com")) 531 531 runScript(t, repositoryDir, fmt.Sprintf("git config user.name %q", "Your Name")) 532 532
+1 -1
gitindex/tree_test.go
··· 261 261 return err 262 262 } 263 263 script := `mkdir adir bdir 264 - git init 264 + git init -b master 265 265 git config user.email "you@example.com" 266 266 git config user.name "Your Name" 267 267