File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ func (w *GitWatcher) __waitpoint__watch_targets(errs chan error) (err error) {
220
220
}
221
221
222
222
func (w * GitWatcher ) handle (e gitwatch.Event ) (err error ) {
223
- target , exists := w .getTarget (e .URL )
223
+ target , exists := w .getTarget (e .Path )
224
224
if ! exists {
225
225
return errors .Errorf ("attempt to handle event for unknown target %s at %s" , e .URL , e .Path )
226
226
}
@@ -233,10 +233,10 @@ func (w *GitWatcher) handle(e gitwatch.Event) (err error) {
233
233
}
234
234
235
235
func getTargetPath (t task.Target ) string {
236
- if t .Branch != "" {
237
- return fmt .Sprintf ("%s_%s" , t .Name , t .Branch )
238
- }
239
- return t .Name
236
+ if t .Branch != "" {
237
+ return fmt .Sprintf ("%s_%s" , t .Name , t .Branch )
238
+ }
239
+ return t .Name
240
240
}
241
241
242
242
func (w GitWatcher ) getAuthForTarget (t task.Target ) (transport.AuthMethod , error ) {
@@ -274,9 +274,10 @@ func (w GitWatcher) executeTargets(targets []task.Target, shutdown bool) {
274
274
}
275
275
}
276
276
277
- func (w GitWatcher ) getTarget (url string ) (target task.Target , exists bool ) {
277
+ func (w GitWatcher ) getTarget (path string ) (target task.Target , exists bool ) {
278
278
for _ , t := range w .state .Targets {
279
- if t .RepoURL == url {
279
+ targetPath := filepath .Join (w .directory , getTargetPath (t ))
280
+ if targetPath == path {
280
281
return t , true
281
282
}
282
283
}
You can’t perform that action at this time.
0 commit comments