gitlab_git 7.2.19 → 7.2.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/repository.rb +41 -5
  4. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67ef4ed15aef21f374891ff34902b43458b1d571
4
- data.tar.gz: c42c73310105cbf1678b015a6fb8ab2c7dd6aaef
3
+ metadata.gz: a393cfb18d2b90f34cc0f18bde16faf26192bfe6
4
+ data.tar.gz: 95b7df2c442710925031b6431c245aca5fe50611
5
5
  SHA512:
6
- metadata.gz: a4c8012aea7f188bbc3d46692b5cd7e700a921309fc7b01897816ec199afa4c8bfdcea05b953de0a57b22da7c85428ef2f5f295d7a1b5930b2f9a8fd8d5fb772
7
- data.tar.gz: f32eea0df1d2969f7f52c2641a35ac34615acd285e486576f730d034fcc19255cd122ad851ff2bcb17835dd25ec79ad261e08e911fa33110a0a8542ecc382d24
6
+ metadata.gz: 513de6ba75ee85637d97e747af0fdd305e7616afe9bb1daa87bc7d35837bdc223ab3ba60403e0170e84406ad857f257c266786e2074eb98278a563bd17c5ff1c
7
+ data.tar.gz: 2e4771e133a950bfa0cbddbad3c0d8ae832f1d38f4af621286d72adf15d3573cfd2d3f3cdf5fe04eac7e7548f358d3f129b701fe1ab92aed77c9e62cd2b1f11e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.19
1
+ 7.2.20
@@ -457,7 +457,8 @@ module Gitlab
457
457
  def commit_count(ref)
458
458
  walker = Rugged::Walker.new(rugged)
459
459
  walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
460
- walker.push(ref)
460
+ oid = rugged.rev_parse_oid(ref)
461
+ walker.push(oid)
461
462
  walker.count
462
463
  end
463
464
 
@@ -645,7 +646,7 @@ module Gitlab
645
646
  rugged.branches.create(ref, start_point)
646
647
  options.delete(:b)
647
648
  end
648
- default_options = { strategy: :safe_create }
649
+ default_options = { strategy: [:recreate_missing, :safe] }
649
650
  rugged.checkout(ref, default_options.merge(options))
650
651
  end
651
652
 
@@ -654,6 +655,43 @@ module Gitlab
654
655
  rugged.branches.delete(branch_name)
655
656
  end
656
657
 
658
+ # Create a new branch named **ref+ based on **stat_point+, HEAD by default
659
+ #
660
+ # Examples:
661
+ # create_branch("feature")
662
+ # create_branch("other-feature", "master")
663
+ def create_branch(ref, start_point = "HEAD")
664
+ rugged_ref = rugged.branches.create(ref, start_point)
665
+ Branch.new(rugged_ref.name, rugged_ref.target)
666
+ rescue Rugged::ReferenceError => e
667
+ raise InvalidRef.new("Branch #{ref} already exists") if e.to_s =~ /'refs\/heads\/#{ref}'/
668
+ raise InvalidRef.new("Invalid reference #{start_point}")
669
+ end
670
+
671
+ # Add a tag with +tag_name++ name to the repository in corresponding +ref_target++
672
+ # supports passing a hash of options to create an annotated tag
673
+ #
674
+ # Valid annotation options are:
675
+ # :tagger ::
676
+ # same structure as a committer, the user that is creating the tag
677
+ #
678
+ # :message ::
679
+ # the message to include in the tag annotation
680
+ #
681
+ # Returns a Gitlab::Git::Tag
682
+ def add_tag(tag_name, ref_target, options = nil)
683
+ tag = rugged.tags.create(tag_name, ref_target, options)
684
+ if tag.annotated?
685
+ Tag.new(tag_name, ref_target, tag.annotation.message)
686
+ else
687
+ Tag.new(tag_name, ref_target)
688
+ end
689
+ rescue Rugged::TagError
690
+ raise InvalidRef.new("Tag #{tag_name} already exists")
691
+ rescue Rugged::ReferenceError
692
+ raise InvalidRef.new("Target #{ref_target} is invalid")
693
+ end
694
+
657
695
  # Return an array of this repository's remote names
658
696
  def remote_names
659
697
  rugged.remotes.each_name.to_a
@@ -675,9 +713,7 @@ module Gitlab
675
713
  # repo.update_remote("origin", url: "path/to/repo")
676
714
  def remote_update(remote_name, options = {})
677
715
  # TODO: Implement other remote options
678
- remote = rugged.remotes[remote_name]
679
- remote.url = options[:url] if options[:url]
680
- remote.save
716
+ rugged.remotes.set_url(remote_name, options[:url]) if options[:url]
681
717
  end
682
718
 
683
719
  # Fetch the specified remote
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.19
4
+ version: 7.2.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: gitlab-linguist
14
+ name: github-linguist
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: 4.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: 4.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.22.2
47
+ version: 0.23.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.22.2
54
+ version: 0.23.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: charlock_holmes
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.6'
61
+ version: 0.7.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.6'
68
+ version: 0.7.3
69
69
  description: GitLab wrapper around git objects
70
70
  email: dmitriy.zaporozhets@gmail.com
71
71
  executables: []