Commit Graph

39 Commits

Author SHA1 Message Date
Douwe Maan c72e715522 Raise error when no content is provided 2017-02-24 09:55:01 -06:00
Douwe Maan faa2e2df8f Rename commit_file, commit_dir and remove_file and update specs 2017-02-24 09:55:01 -06:00
Lin Jen-Shin ccc73c455b Rename from base to start because base could mean merge base 2017-01-06 23:29:13 +08:00
Lin Jen-Shin a4b97b2cb6 Rename source to base to avoid confusion from MR 2017-01-06 22:05:30 +08:00
Lin Jen-Shin dc4b3dd0ae Fix source_project and also pass source_project
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_19747556
2016-12-14 01:47:17 +08:00
Lin Jen-Shin 3fa3fcd787 Cleanup parameters, easier to understand and
more consistent across different methodst
2016-12-08 17:08:25 +08:00
Lin Jen-Shin 12f07300d0 Merge remote-tracking branch 'upstream/master' into fix-git-hooks-when-creating-file
* upstream/master: (141 commits)
  Log mv_namespace parameters
  Remove header ids from University docs
  Added test that checks the correct select box is there for the LFS enabled setting.
  Simplify copy on "Create a new list" dropdown in Issue Boards
  Fix `LFS enabled` select box.
  Use Commit#author so we share logic and cache
  Move admin abuse report spinach test to rspec
  fixes non-retina shadow and browser zoom issue
  Use default `closest` if available!
  Adds polyfill for CustomEvent
  Move abuse report spinach test to rspec
  Add support of Chrome/Chromium in requirements.md
  Fixed dragging issues on issue boards
  Grapify the sidekiq metrics API
  Add nested groups support to the routing
  Correctly determine mergeability of MR with no discussions
  API: Add endpoint to delete a group share
  Add a starting date to milestones
  Update ProjectTeam#fetch_members to use project authorizations
  Update ProjectTeam#max_member_access_for_user_ids to use project authorizations
  ...
2016-11-24 17:18:17 +08:00
Semyon Pupkov 724864eeb4 Remove unnecessary require_relative calls from service classes
Rails by default use autoload for all dirs from app folder.
require_relative not needed. See ActiveSupport::Dependencies.autoload_paths
2016-11-22 11:25:00 +05:00
Lin Jen-Shin 0b5a2eef8f Add `source_branch` option for various git operations
If `source_branch` option is passed, and target branch cannot be found,
`Repository#update_branch_with_hooks` would try to create a new branch
from `source_branch`.

This way, we could make changes in the new branch while only firing
the hooks once for the changes. Previously, we can only create a new
branch first then make changes to the new branch, firing hooks twice.
This behaviour is bad for CI.

Fixes #7237
2016-11-15 04:02:10 +08:00
Dan Dunckel ace1155396 Add optional 'author' param when making commits 2016-09-19 10:00:26 -07:00
Valery Sizov 3baed8cb6d Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
Douwe Maan d9c82d679f Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
Ben Ford 3be9d2c422 Add ability to create directories in the editor
Simply type a name with a `/` directory separator and new directories
will be created. This does not do the fancy UI work that github.com
does, but it will get the job done.

I could not find tests for file creation, so I didn't add a test for
this slight behaviour modification. I did test directory traversals
though, using both absolute paths like `/tmp/foo.txt` and relative paths
like `../../foo.txt`. Neither case escaped the repository, though
attempting to traverse with a relative path resulted in a 500 error that
did not affect application stability upon reload.
2015-10-29 15:49:07 +01:00
Stan Hu 0ab6ca93aa Add directory feature button
Change "+" icon under "Files" section to have three options:

* Create file
* Upload file
* New directory

Upload file is no longer accessible from the "Create file" page.
Users can now select a target branch in upload file as well.

Closes #2799: Fixes a bug where file modes were overwritten after a commit

Closes https://github.com/gitlabhq/gitlabhq/issues/8253: Existing files
can no longer be overwritten in the "Create file" section.

Closes #2557
2015-10-07 04:22:55 -07:00
liyakun e2ece2bc35 Add "Replace" and "Upload" features
Refactor upload and replace functionality

    Rename file and move CSS

    Fix typo

    Make dropzone a div

    Remove unnecessary file

    Change color of "upload existing one"

    Add missing changes
2015-09-15 02:12:56 +02:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9bc512314a
Revert "Create and edit files in web editor via rugged"
This reverts commit 734a4ba87d.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 11:52:33 +02:00
Dmitriy Zaporozhets 0806605962
Revert "Fix adding new file to empty repo"
This reverts commit 27a158506e.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 11:51:26 +02:00
Dmitriy Zaporozhets 815e678c4e Revert "Use rugged in web editor for base64 encoding"
This reverts commit 541133197b.
2015-08-11 11:50:48 +02:00
Dmitriy Zaporozhets 34975f0180 Revert "Create activity event and execute hooks on web editor commit"
This reverts commit 3d416f1682.
2015-08-11 11:50:43 +02:00
Dmitriy Zaporozhets 24332b7b99 Revert "Make web editor work correctly after switch from satellites"
This reverts commit 435f680b89.
2015-08-11 11:49:29 +02:00
Dmitriy Zaporozhets d4cfa0bf76
Revert "Refactor web editor"
This reverts commit dfccb06dda.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 11:49:09 +02:00
Dmitriy Zaporozhets dfccb06dda
Refactor web editor
* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-05 15:01:38 +02:00
Dmitriy Zaporozhets 435f680b89
Make web editor work correctly after switch from satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-02 12:06:40 +02:00
Dmitriy Zaporozhets 3d416f1682
Create activity event and execute hooks on web editor commit
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-02 10:45:13 +02:00
Dmitriy Zaporozhets 541133197b
Use rugged in web editor for base64 encoding
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-01 23:43:35 +02:00
Dmitriy Zaporozhets 27a158506e
Fix adding new file to empty repo
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-01 21:17:13 +02:00
Dmitriy Zaporozhets 734a4ba87d
Create and edit files in web editor via rugged
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-01 20:49:11 +02:00
Douwe Maan dfe0f9eedf Use more specific regexes. 2015-03-27 11:09:29 +01:00
Douwe Maan 4830b2be5e Refactor GitAccess to use instance variables. 2015-03-24 14:11:48 +01:00
Valery Sizov 71a844cdae Web Editor: save to new branch 2015-02-24 11:43:20 +02:00
Dmitriy Zaporozhets 3e47ea5064 Files::CreateService can now commit file to empty repository 2015-01-26 13:31:24 -08:00
Valery Sizov ab7a79bf3b developer can push to protected branches 2015-01-20 17:34:23 -08:00
Ciro Santilli b1c40e8151 Fix username validation message to match regexp.
Also used for project, group and web ui new file names.
2014-06-26 13:31:34 +02:00
Dmitriy Zaporozhets 55572c4e86
Repository#blob_at_branch
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-05 11:39:55 +02:00
Dmitriy Zaporozhets fc16a228c9
Fix blobs for file services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-05 09:02:13 +02:00
Dmitriy Zaporozhets f0d2d28118 Merge branch 'refactoring/context_into_services' into 'master'
Refactoring context Into services

To prevent confusion where to write logic. Context or Service?
2014-01-17 09:47:47 +00:00
Dmitriy Zaporozhets 4d82e9ed0b
Fix require for file services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-16 20:36:51 +02:00
Dmitriy Zaporozhets 1d2bdb4d58
Move all Context classes into Services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-16 19:03:42 +02:00