Pipelines do not run when using `only:changes` and force pushing

Summary

When force pushing over the latest commit on a branch, pipelines fail to trigger when using only:changes syntax.

Steps to reproduce

  1. Create a pipeline that uses only:changes. Example:
something:
  stage: test
  script: echo "I ran!"
  only:
    changes:
      - "some_dir/**/*"
  1. Make a change in some_dir and push to a branch. The pipeline should run.
git checkout -b my-change
... Make some change. ...
git commit -m "Some change"
git push origin my-change
  1. Force push over the latest commit. The pipeline doesn't run again.
git commit --amend --no-edit
git push --force origin my-change

What is the current bug behavior?

The pipeline does not execute when force pushing.

What is the expected correct behavior?

The pipeline executes again.

Relevant logs and/or screenshots

n/a

Output of checks

n/a

Results of GitLab environment info

GitLab Enterprise Edition 11.11.0-ee

Results of GitLab application Check

n/a

Possible fixes

n/a

Assignee Loading
Time tracking Loading