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) {
220220}
221221
222222func (w * GitWatcher ) handle (e gitwatch.Event ) (err error ) {
223- target , exists := w .getTarget (e .URL )
223+ target , exists := w .getTarget (e .Path )
224224 if ! exists {
225225 return errors .Errorf ("attempt to handle event for unknown target %s at %s" , e .URL , e .Path )
226226 }
@@ -233,10 +233,10 @@ func (w *GitWatcher) handle(e gitwatch.Event) (err error) {
233233}
234234
235235func 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
240240}
241241
242242func (w GitWatcher ) getAuthForTarget (t task.Target ) (transport.AuthMethod , error ) {
@@ -274,9 +274,10 @@ func (w GitWatcher) executeTargets(targets []task.Target, shutdown bool) {
274274 }
275275}
276276
277- func (w GitWatcher ) getTarget (url string ) (target task.Target , exists bool ) {
277+ func (w GitWatcher ) getTarget (path string ) (target task.Target , exists bool ) {
278278 for _ , t := range w .state .Targets {
279- if t .RepoURL == url {
279+ targetPath := filepath .Join (w .directory , getTargetPath (t ))
280+ if targetPath == path {
280281 return t , true
281282 }
282283 }
You can’t perform that action at this time.
0 commit comments