Skip to content
Snippets Groups Projects
Commit 094083b3 authored by Jacob Vosmaer's avatar Jacob Vosmaer :wave: Committed by Zeger-Jan van de Weg
Browse files

FetchIntoObjectPool: pack refs after fetch

parent 639ad1a3
No related branches found
No related tags found
No related merge requests found
---
title: 'FetchIntoObjectPool: pack refs after fetch'
merge_request: 1464
author:
type: performance
......@@ -79,6 +79,14 @@ func (o *ObjectPool) FetchFromOrigin(ctx context.Context, origin *gitalypb.Repos
return err
}
packRefs, err := git.Command(ctx, o, "pack-refs", "--all")
if err != nil {
return err
}
if err := packRefs.Wait(); err != nil {
return err
}
return repackPool(ctx, o)
}
......
......@@ -182,6 +182,10 @@ func TestFetchFromOriginRefUpdates(t *testing.T) {
for ref, oid := range newRefs {
require.Equal(t, oid, resolveRef(t, poolPath, "refs/remotes/origin/"+ref), "look up %q in pool after update", ref)
}
looseRefs := testhelper.MustRunCommand(t, nil, "find", filepath.Join(poolPath, "refs"), "-type", "f")
require.Equal(t, "", string(looseRefs), "there should be no loose refs after the fetch")
}
func resolveRef(t *testing.T, repo string, ref string) string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment