Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions components/content-service/pkg/initializer/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,6 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping)
return
}

// https://github.blog/2019-11-03-highlights-from-git-2-24/
err = ws.Git(ctx, "config", "feature.manyFiles", "true")
if err != nil {
log.WithError(err).Error("cannot configure feature.manyFiles")
}

// commit-graph after every git fetch command that downloads a pack-file from a remote
err = ws.Git(ctx, "config", "fetch.writeCommitGraph", "true")
if err != nil {
log.WithError(err).Error("cannot configure fetch.writeCommitGraph")
}

gitClone := func() error {
if err := os.MkdirAll(ws.Location, 0775); err != nil {
log.WithError(err).WithField("location", ws.Location).Error("cannot create directory")
Expand Down Expand Up @@ -122,9 +110,21 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping)
return err
}

// we can only do `git config` stuffs after having a directory that is also git init'd
// https://github.blog/2019-11-03-highlights-from-git-2-24/
err = ws.Git(ctx, "config", "feature.manyFiles", "true")
if err != nil {
log.WithError(err).WithField("location", ws.Location).Error("cannot configure feature.manyFiles")
}
// commit-graph after every git fetch command that downloads a pack-file from a remote
err = ws.Git(ctx, "config", "fetch.writeCommitGraph", "true")
if err != nil {
log.WithError(err).WithField("location", ws.Location).Error("cannot configure fetch.writeCommitGraph")
}

err = ws.Git(ctx, "config", "--replace-all", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*")
if err != nil {
log.WithError(err).WithField("location", ws.Location).Error("cannot configure fecth behavior")
log.WithError(err).WithField("location", ws.Location).Error("cannot configure fetch behavior")
}

err = ws.Git(ctx, "config", "--replace-all", "checkout.defaultRemote", "origin")
Expand Down