Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now

Editor autocomplete replaces <directory>/.gitignore with just .gitignore

Summary

I wanted to create a directory in Git, and with the knowledge of a placeholder like .gitignore, I've opened the editor to add a new file.

Using images/.gitignore the auto-complete template detection always replaces this with just .gitignore, it doesn't let you edit this anymore.

Screen_Shot_2019-10-25_at_15.11.49

Screen_Shot_2019-10-25_at_15.11.57

If you pick images/.gitkeep instead, this works.

Screen_Shot_2019-10-25_at_15.15.14

Steps to reproduce

  • Create or modify an existing repository, best empty
  • Add a new file
  • Use images/.gitignore as path, but type it character by character
  • See auto-complete replacing it

To be honest, I've found out that creating a new directory is a GitLab action from the menu available too. Didn't know that beforehand.

Example Project

Not possible, it is a live action in the editor everyone sees.

What is the current bug behavior?

JS autocomplete replaces the file name including a directory, but only with .gitignore in the path.

What is the expected correct behavior?

Keep the path since this also works in the editor and Web IDE :)

Relevant logs and/or screenshots

See above.

Output of checks

This bug happens on GitLab.com

Possible fixes

Allow path pre-pending for .gitignore template matches in the auto-complete code.

Assignee Loading
Time tracking Loading