55 */
66
77import { injectable , inject } from "inversify" ;
8+ import { createHash } from "crypto" ;
9+ import path from "path" ;
810import { HostContextProvider } from "../auth/host-context-provider" ;
911import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing" ;
1012import {
@@ -18,7 +20,6 @@ import {
1820 User ,
1921 AdditionalContentContext ,
2022} from "@gitpod/gitpod-protocol" ;
21- import { createHash } from "crypto" ;
2223import { ImageFileRevisionMissing , RevisionNotFoundError } from "../repohost" ;
2324
2425@injectable ( )
@@ -45,7 +46,12 @@ export class ImageSourceProvider {
4546 throw new Error ( `Cannot fetch workspace image source for host: ${ repository . host } ` ) ;
4647 }
4748 const lastDockerFileSha = await hostContext . services . fileProvider
48- . getLastChangeRevision ( repository , imgcfg . externalSource . revision , user , imgcfg . file )
49+ . getLastChangeRevision (
50+ repository ,
51+ imgcfg . externalSource . revision ,
52+ user ,
53+ path . normalize ( imgcfg . file ) ,
54+ )
4955 . catch ( ( e ) => {
5056 if ( e instanceof RevisionNotFoundError ) {
5157 return ImageFileRevisionMissing ;
@@ -76,7 +82,7 @@ export class ImageSourceProvider {
7682 throw new Error ( `Cannot fetch workspace image source for host: ${ context . repository . host } ` ) ;
7783 }
7884 const lastDockerFileSha = await hostContext . services . fileProvider
79- . getLastChangeRevision ( context . repository , context . revision , user , imgcfg . file )
85+ . getLastChangeRevision ( context . repository , context . revision , user , path . normalize ( imgcfg . file ) )
8086 . catch ( ( e ) => {
8187 if ( e instanceof RevisionNotFoundError ) {
8288 return ImageFileRevisionMissing ;
0 commit comments