diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-10-12 14:53:32 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-10-12 14:53:32 +0000 |
commit | 400557f0baa789aef52462f954c6f0be77fc99fc (patch) | |
tree | 1f32a52f5f23a330b4fd2e97c77376ba5dff270b /spec/lib | |
parent | ca06ff27874d96705b7878a17179ffb25d809aba (diff) | |
parent | 1731934398aedfec89ad006818b55641dc1f789c (diff) | |
download | gitlab-ce-400557f0baa789aef52462f954c6f0be77fc99fc.tar.gz |
Merge branch 'gitaly-fetch-remote' into 'master'
Add `Gitlab::Git::Repository#fetch` command
Closes gitaly#586
See merge request gitlab-org/gitlab-ce!14772
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index d959562c951..1b7486eaea1 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1510,6 +1510,21 @@ describe Gitlab::Git::Repository, seed_helper: true do end end + describe '#fetch' do + let(:git_path) { Gitlab.config.git.bin_path } + let(:remote_name) { 'my_remote' } + + subject { repository.fetch(remote_name) } + + it 'fetches the remote and returns true if the command was successful' do + expect(repository).to receive(:popen) + .with(%W(#{git_path} fetch #{remote_name}), repository.path) + .and_return(['', 0]) + + expect(subject).to be(true) + end + end + def create_remote_branch(repository, remote_name, branch_name, source_branch_name) source_branch = repository.branches.find { |branch| branch.name == source_branch_name } rugged = repository.rugged |