Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
d143cae9
Commit
d143cae9
authored
Jan 18, 2017
by
Regis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ui_pipelines_mini_graph
parents
97610fda
5e9196b3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
5 deletions
+51
-5
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+10
-1
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+1
-1
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-1
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-1
changelogs/unreleased/clipboard-button-commit-sha.yml
changelogs/unreleased/clipboard-button-commit-sha.yml
+3
-0
changelogs/unreleased/i--25814-500-error.yml
changelogs/unreleased/i--25814-500-error.yml
+4
-0
doc/workflow/importing/migrating_from_svn.md
doc/workflow/importing/migrating_from_svn.md
+1
-1
spec/controllers/projects/compare_controller_spec.rb
spec/controllers/projects/compare_controller_spec.rb
+30
-0
No files found.
app/controllers/projects/compare_controller.rb
View file @
d143cae9
...
...
@@ -25,9 +25,18 @@ class Projects::CompareController < Projects::ApplicationController
end
def
create
if
params
[
:from
].
blank?
||
params
[
:to
].
blank?
flash
[
:alert
]
=
"You must select from and to branches"
from_to_vars
=
{
from:
params
[
:from
].
presence
,
to:
params
[
:to
].
presence
}
redirect_to
namespace_project_compare_index_path
(
@project
.
namespace
,
@project
,
from_to_vars
)
else
redirect_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
params
[
:from
],
params
[
:to
])
end
end
private
...
...
app/views/projects/commit/_commit_box.html.haml
View file @
d143cae9
.page-content-header
.header-main-content
%strong
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
clipboard_button
(
clipboard_text:
@commit
.
id
,
title:
"Copy commit SHA to clipboard"
)
=
@commit
.
short_id
%span
.hidden-xs
authored
#{
time_ago_with_tooltip
(
@commit
.
authored_date
)
}
...
...
app/views/projects/commits/_commit.html.haml
View file @
d143cae9
...
...
@@ -36,6 +36,6 @@
.table-list-cell.commit-actions.hidden-xs
-
if
commit
.
status
(
ref
)
=
render_commit_status
(
commit
,
ref:
ref
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
clipboard_button
(
clipboard_text:
commit
.
id
,
title:
"Copy commit SHA to clipboard"
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit-short-id btn btn-transparent"
=
link_to_browse_code
(
project
,
commit
)
app/views/projects/tree/_tree_content.html.haml
View file @
d143cae9
...
...
@@ -8,7 +8,7 @@
.pull-left
Last commit
.last-commit.hidden-sm.pull-left
%small
.light
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
clipboard_button
(
clipboard_text:
@commit
.
id
,
title:
"Copy commit SHA to clipboard"
)
=
link_to
@commit
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"monospace"
=
time_ago_with_tooltip
(
@commit
.
committed_date
)
=
@commit
.
full_title
...
...
changelogs/unreleased/clipboard-button-commit-sha.yml
0 → 100644
View file @
d143cae9
---
title
:
'
Copy
commit
SHA
to
clipboard'
merge_request
:
8547
changelogs/unreleased/i--25814-500-error.yml
0 → 100644
View file @
d143cae9
---
title
:
Fix Compare page throws 500 error when any branch/reference is not selected
merge_request
:
8492
author
:
Martin Cabrera
doc/workflow/importing/migrating_from_svn.md
View file @
d143cae9
...
...
@@ -79,7 +79,7 @@ Now that SubGit has configured the Git/SVN repos, run `subgit` to perform the
initial translation of existing SVN revisions into the Git repository:
```
subgit install $GIT_REPO
S
_PATH
subgit install $GIT_REPO_PATH
```
After the initial translation is completed, the Git repository and the SVN
...
...
spec/controllers/projects/compare_controller_spec.rb
View file @
d143cae9
...
...
@@ -64,6 +64,36 @@ describe Projects::CompareController do
expect
(
assigns
(
:diffs
)).
to
eq
(
nil
)
expect
(
assigns
(
:commits
)).
to
eq
(
nil
)
end
it
'redirects back to index when params[:from] is empty and preserves params[:to]'
do
post
(
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
''
,
to:
'master'
)
expect
(
response
).
to
redirect_to
(
namespace_project_compare_index_path
(
project
.
namespace
,
project
,
to:
'master'
))
end
it
'redirects back to index when params[:to] is empty and preserves params[:from]'
do
post
(
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
'master'
,
to:
''
)
expect
(
response
).
to
redirect_to
(
namespace_project_compare_index_path
(
project
.
namespace
,
project
,
from:
'master'
))
end
it
'redirects back to index when params[:from] and params[:to] are empty'
do
post
(
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
from:
''
,
to:
''
)
expect
(
response
).
to
redirect_to
(
namespace_project_compare_index_path
)
end
end
describe
'GET diff_for_path'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment