5
5
*/
6
6
7
7
import { injectable , inject } from "inversify" ;
8
+ import { createHash } from "crypto" ;
9
+ import path from "path" ;
8
10
import { HostContextProvider } from "../auth/host-context-provider" ;
9
11
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing" ;
10
12
import {
@@ -18,7 +20,6 @@ import {
18
20
User ,
19
21
AdditionalContentContext ,
20
22
} from "@gitpod/gitpod-protocol" ;
21
- import { createHash } from "crypto" ;
22
23
import { ImageFileRevisionMissing , RevisionNotFoundError } from "../repohost" ;
23
24
24
25
@injectable ( )
@@ -45,7 +46,12 @@ export class ImageSourceProvider {
45
46
throw new Error ( `Cannot fetch workspace image source for host: ${ repository . host } ` ) ;
46
47
}
47
48
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
+ )
49
55
. catch ( ( e ) => {
50
56
if ( e instanceof RevisionNotFoundError ) {
51
57
return ImageFileRevisionMissing ;
@@ -76,7 +82,7 @@ export class ImageSourceProvider {
76
82
throw new Error ( `Cannot fetch workspace image source for host: ${ context . repository . host } ` ) ;
77
83
}
78
84
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 ) )
80
86
. catch ( ( e ) => {
81
87
if ( e instanceof RevisionNotFoundError ) {
82
88
return ImageFileRevisionMissing ;
0 commit comments