gitlab-org--gitlab-foss/spec
Pierre de La Morinerie 18295585d9 Fix MergeRequest#source_sha when there is no diff
`MergeRequest#source_sha` is expected to return the sha of the source
branch last commit.

But when a open Merge Request has no diff (e.g. all commits have already
been merged to the target branch), `merge_request.source_sha`
incorrectly returns `nil`.

This was un-noticed before – but now that !2217 has been merged,
it makes `Gitlab::Git::Commit.between` raise an
"Unexpected nil argument" exception.

This fixes the crash, by making sure that `source_sha` returns a
correct result even when there is no diff available.
2016-03-16 14:02:04 +01:00
..
config Don't load all of GitLab in mail_room 2016-02-26 18:48:13 -08:00
controllers Revert "Merge branch 'avatar-cropping' into 'master' " 2016-03-15 14:55:40 +01:00
factories Fix MergeRequest#source_sha when there is no diff 2016-03-16 14:02:04 +01:00
features Merge branch 'comment-discard-button' into 'master' 2016-03-11 13:07:43 +00:00
finders Bring shared project feature tests from EE 2016-03-12 14:45:14 +01:00
fixtures Add support for keyword arguments in label reference method 2016-03-03 10:41:11 +01:00
helpers Revert "Merge branch 'avatar-cropping' into 'master' " 2016-03-15 14:55:40 +01:00
initializers Ensure Gravatar host looks like an actual host 2016-01-18 14:58:16 +01:00
javascripts Change `js-quick-submit` behavior to expect the class on the form 2016-03-02 15:11:15 -05:00
lib Return an empty Array when there aren't lines to parse. 2016-03-15 19:51:27 -05:00
mailers Improving the original label-subscribing implementation 2016-03-15 18:22:02 +01:00
models Fix MergeRequest#source_sha when there is no diff 2016-03-16 14:02:04 +01:00
requests Merge branch 'share-project-ce' into 'master' 2016-03-14 16:38:52 +00:00
routing Remove `Profile::KeysController#new` action 2016-03-03 16:13:59 -05:00
services Specs for the DeleteUserService 2016-03-15 22:19:51 +01:00
support Merge branch 'fix-capybara-deprecation-warnings' into 'master' 2016-03-16 00:00:38 +00:00
tasks/gitlab Add lfs to backup specs. 2015-11-19 10:43:45 +01:00
views Move "I should see Crowd login form" feature to a view spec 2016-02-24 17:38:13 -05:00
workers Specs for the DeleteUserService 2016-03-15 22:19:51 +01:00
factories_spec.rb
rails_helper.rb Started on the actual rspec 3 upgrade 2015-06-22 12:12:49 +02:00
spec_helper.rb Original implementation to allow users to subscribe to labels 2016-03-15 17:25:37 +01:00
teaspoon_env.rb