File locking feature interferes with lfs file locking

Summary

A repository with lfs enabled every file can be locked with git lfs lock FILE regardless of what the gitattributes declares lockable. It even works without having any gitattributes

Steps to reproduce

  • Create a repository with lfs enabled
  • Create a few files
  • lock files via git lfs lock

What is the current bug behavior?

Files that are not lfs tracked can be locked with git lfs lock Files that are not marked as lockable can be locked with git lfs lock

What is the expected correct behavior?

Only files that are tracked and marked lockable should be lockable via git lfs lock, i.e. gitattributes should be respected

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: unknown

GitLab information Version: 11.10.0-ee Revision: dfa95630be4 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.11 Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 9.0.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.0.0 ? ... OK (9.0.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 8/2 ... yes 8/3 ... yes 7/4 ... yes 6/5 ... yes 8/6 ... yes 7/7 ... yes 7/9 ... yes 9/11 ... yes 9/12 ... yes 7/13 ... yes 9/14 ... yes 9/15 ... yes 9/16 ... yes 7/17 ... yes 7/19 ... yes 7/20 ... yes 7/21 ... yes 7/23 ... yes 9/25 ... yes 9/26 ... yes 13/27 ... yes 7/28 ... yes 7/29 ... yes 14/31 ... yes 14/32 ... yes 14/33 ... yes 14/34 ... yes 14/35 ... yes 7/36 ... yes 17/37 ... yes 17/38 ... yes 17/39 ... yes 7/41 ... yes 17/42 ... yes 7/43 ... yes 2/44 ... yes 20/46 ... yes 22/47 ... yes 3/48 ... yes 24/49 ... yes 24/50 ... yes 3/51 ... yes 9/52 ... yes 8/54 ... yes 2/55 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 8 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Edited Sep 02, 2020 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading