git-bundle 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git_bundle/commands/generic.rb +1 -1
- data/lib/git_bundle/repository.rb +23 -13
- data/lib/git_bundle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8feeeb925b20aaf6289003e567f9f243e03d518
|
4
|
+
data.tar.gz: e8eac2a34eefd759c6a726c9e04e227fc736b623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 457e165a94c0e638a4437b6eb85aa6ad983673ae4573c24abb52f08e6e41942b1ac3f5105e3a3bb79ff4e9df6edef349eb7ae06ee5807846a46809ba8196ffd5
|
7
|
+
data.tar.gz: f3c240557a740e25d9ee5baab591e9ff224123d7732f65f3703b8c44545418a02a747109fe489fdf3bd8df6237b9d8bc151b24ef843a74d81987ce28c3441c75
|
@@ -21,7 +21,7 @@ module GitBundle
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def branch
|
24
|
-
@branch ||= execute_git('rev-parse --abbrev-ref HEAD')
|
24
|
+
@branch ||= execute_git('rev-parse', '--abbrev-ref', 'HEAD').chomp
|
25
25
|
end
|
26
26
|
|
27
27
|
def locked_branch
|
@@ -29,7 +29,7 @@ module GitBundle
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def revision
|
32
|
-
@revision ||= execute_git('rev-parse --verify HEAD').gsub("\n", '')
|
32
|
+
@revision ||= execute_git('rev-parse', '--verify', 'HEAD').gsub("\n", '')
|
33
33
|
end
|
34
34
|
|
35
35
|
def locked_revision
|
@@ -37,37 +37,47 @@ module GitBundle
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def commits_not_pushed
|
40
|
-
execute_git(
|
40
|
+
execute_git('rev-list', '--pretty=oneline', '--abbrev-commit', "origin/#{branch}..#{branch}")
|
41
41
|
end
|
42
42
|
|
43
43
|
def commit_messages_not_pushed
|
44
|
-
count = execute_git(
|
45
|
-
count.times.map { |num| execute_git(
|
44
|
+
count = execute_git('rev-list', "origin/#{branch}..#{branch}", '--count').to_i
|
45
|
+
count.times.map { |num| execute_git('rev-list', '--pretty=oneline', "--skip=#{num}", '--max-count=1', "origin/#{branch}..#{branch}").sub(/\h*\s/, '').strip }
|
46
46
|
end
|
47
47
|
|
48
48
|
def push(args)
|
49
|
-
puts execute_git(
|
49
|
+
puts execute_git('push', args)
|
50
50
|
$?.exitstatus == 0
|
51
51
|
end
|
52
52
|
|
53
53
|
def file_changed?(filename)
|
54
|
-
!execute_git(
|
54
|
+
!execute_git('diff', '--name-only', filename).empty? && $?.exitstatus == 0
|
55
55
|
end
|
56
56
|
|
57
57
|
def add_file(filename)
|
58
|
-
execute_git(
|
58
|
+
execute_git('add', filename)
|
59
59
|
$?.exitstatus == 0
|
60
60
|
end
|
61
61
|
|
62
62
|
def commit(message, *files)
|
63
|
-
execute_git(
|
63
|
+
execute_git('commit', '-m', message, files)
|
64
64
|
$?.exitstatus == 0
|
65
65
|
end
|
66
66
|
|
67
|
-
def execute_git(
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
def execute_git(*args, **options)
|
68
|
+
git_command = ['git', '-C', @path]
|
69
|
+
git_command += %w(-c color.status=always -c color.ui=always) if options.fetch(:color, false)
|
70
|
+
git_command += args.flatten
|
71
|
+
execute(*git_command)
|
72
|
+
end
|
73
|
+
|
74
|
+
def execute(*args)
|
75
|
+
puts args.map{ |arg| "'#{arg}'" }.join(' ') if ENV['DEBUG'] == 'true'
|
76
|
+
|
77
|
+
pipe_out, pipe_in = IO.pipe
|
78
|
+
system *args, out: pipe_in, err: pipe_in
|
79
|
+
pipe_in.close
|
80
|
+
pipe_out.read
|
71
81
|
end
|
72
82
|
end
|
73
83
|
end
|
data/lib/git_bundle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Pretorius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|