"Close #issue" in commit message doesn't work for first commit
Summary
If the commit message contains Close #issue (where issue is the issue number), the issue should get closed. But if a commit is the very first commit in a project, the issue doesn't close. A subsequent commit does close the issue.
Possibly related to gitlab-qa#53 (moved)
Discovered by @sven.kroell while writing a test of the feature: https://gitlab.com/gitlab-org/gitlab-ce/issues/52707
Steps to reproduce
- Create an empty project.
- Create an issue (issue
#1) - Push a commit with the message
Closes #1 - Check if the issue is closed.
Example Project
That's a project in which I used git to push the commits. You can see in the commit log that the commit SHA matches the latest commit, not the first one.
The project shows the same bug, but that time I used the UI to add files and commit.
What is the current bug behavior?
An issue isn't closed by a commit message if it's the very first commit to the project.
What is the expected correct behavior?
The issue is closed.
Output of checks
This bug happens on GitLab.com
/cc @stanhu @smcgivern