git: fix cachemap bug on sha identifier
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>docker-18.09
parent
9c044db670
commit
a2072e6a47
|
@ -171,7 +171,7 @@ func (gs *gitSourceHandler) CacheKey(ctx context.Context, index int) (string, bo
|
||||||
|
|
||||||
if isCommitSHA(ref) {
|
if isCommitSHA(ref) {
|
||||||
gs.cacheKey = ref
|
gs.cacheKey = ref
|
||||||
return ref, false, nil
|
return ref, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
gitDir, unmountGitDir, err := gs.mountRemote(ctx, remote)
|
gitDir, unmountGitDir, err := gs.mountRemote(ctx, remote)
|
||||||
|
|
|
@ -167,8 +167,9 @@ func testFetchBySHA(t *testing.T, keepGitDir bool) {
|
||||||
g, err := gs.Resolve(ctx, id)
|
g, err := gs.Resolve(ctx, id)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
key1, _, err := g.CacheKey(ctx, 0)
|
key1, done, err := g.CacheKey(ctx, 0)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
require.True(t, done)
|
||||||
|
|
||||||
require.Equal(t, 40, len(key1))
|
require.Equal(t, 40, len(key1))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue