Commit graph

15 commits

Author SHA1 Message Date
James Edwards-Jones
d2a77094ae File upload UI obeys LFS filters
Uses Lfs::FileModificationHandler to coordinate LFS detection, creation of LfsObject, etc

Caveats:
 1. This isn't used by the multi-file editor / Web IDE
 2. This isn't used on rename. We'd need to be able to download LFS files
    and add them to the commit if they no longer match so not as simple.
 3. We only check the root .gitattributes file, so this should be improved
    to correctly check for nested .gitattributes files in subfolders.
2018-02-06 15:26:25 +00:00
Alejandro Rodríguez
2e0951e93f Incorporate Gitaly's OperationService.UserCommitFiles RPC 2018-01-22 13:34:51 -03:00
Alejandro Rodríguez
0b07be594e Move git operations for multi_action into Gitlab::Git 2018-01-05 15:17:53 -03:00
blackst0ne
27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Rubén Dávila
c927e57466 Updates from last code review:
- Apply some refactoring for code reuse
- Add file status validation for Files::DeleteService
- Write additional specs
2017-12-20 10:57:27 -05:00
Rubén Dávila
c210ddab92 Check if file has been modified for each action provided.
When commiting multiple files we're now checking if any of those files
has been modified by another commit and we're rejecting the new commit
in this case.
2017-12-20 01:24:53 -05:00
Rubén Dávila
81331fa77e Add some initial specs for Files::MultiService class 2017-12-20 01:24:53 -05:00
Jacob Vosmaer
dc7c6bede2 Move GitHooksService to Gitlab::Git 2017-08-23 10:45:20 +02:00
Grzegorz Bizon
0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Douwe Maan
d170133bde Refactor changing files in web UI 2017-04-20 00:37:44 +00:00
Robert Speicher
ca9a79f620 Use :empty_project where possible in service specs 2017-03-27 20:44:09 -04:00
Lin Jen-Shin
a639454032 Fix renaming 2017-01-07 00:31:11 +08:00
Lin Jen-Shin
92aa402882 Add a test to make sure hooks are fire only once
when updating a file to a different branch.
2016-11-05 02:48:58 +08:00
Marc Siegfriedt
a1ee8cf5ad multi-file commit
add docs and tests - add additional validation
allow move without content
updated response
2016-10-05 17:42:52 +00:00
Frank West
ade0c2c892 Prevents accidental overwrites of commits from UI
Currently when a user performs an update of a file through the UI  and there
has already been a change committed to the file the previous commits will be
overwritten without a check to see if the file has been changed.

This commit uses the last commit sha at the time the user starts editing the
file and compares it with the current sha of the file being edited to ensure
they are the same before committing the file. If the shas do not match we
throw an exception preventing the commit from the commit from occurring.

Fixes #5857
2016-08-15 02:34:55 +00:00