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

Configure Feed

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

gitindex: do not resolve HEAD ref

We currently call the branch HEAD in zoekt-archive-index and Sourcegraph
assumes this.

Change-Id: Ie875aadfc5f25c4ad870922d5933076ee1bf904d

+10 -2
-1
README.md
··· 20 20 which supports cancellation). 21 21 - Query primitive `RepoSet` to efficiently specify a set of repositories to 22 22 search. 23 - - We vendor in all dependencies. 24 23 - Allow empty shard directories on startup. Needed when starting a fresh 25 24 instance which hasn't indexed anything yet. 26 25 - We can return symbol/ctag data in results. Additionally we can run symbol regex queries.
+7
cmd/zoekt-sourcegraph-indexserver/index.go
··· 170 170 "-submodules=false", 171 171 } 172 172 173 + // Note: we ignore o.Commit, we just fetch/clone the branch. This means the 174 + // commit could be different (due to the branch being updated). This is not 175 + // an issue since this commit will be more up to date. Additionally we will 176 + // eventually converge thanks to the -incremental check. The only downside 177 + // is the log message for indexing may report we indexed a different commit 178 + // than we actually did. 179 + 173 180 // Even though we check for incremental in this process, we still pass it 174 181 // in just in case we regress in how we check in process. We will still 175 182 // notice thanks to metrics and increased load on gitserver.
+3 -1
gitindex/index.go
··· 315 315 func expandBranches(repo *git.Repository, bs []string, prefix string) ([]string, error) { 316 316 var result []string 317 317 for _, b := range bs { 318 - if b == "HEAD" { 318 + // Sourcegraph: We disable resolving refs. We want to return the exact ref 319 + // requested so we can match it up. 320 + if b == "HEAD" && false { 319 321 ref, err := repo.Head() 320 322 if err != nil { 321 323 return nil, err