geordi 0.9.12 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/remotify-local-branch +13 -6
- data/lib/geordi/version.rb +1 -1
- metadata +5 -5
data/bin/remotify-local-branch
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
# detect current branch
|
4
|
+
current_branch = (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').scan(/^\* (.+)$/).flatten.first
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
# use branch passed via command line or current branch if none was given
|
7
|
+
branch = ARGV[0] || current_branch || raise("Need the branch name as first argument since the current branch could not be detected automatically")
|
8
|
+
|
9
|
+
# switch the branch if it is not the current branch
|
10
|
+
if branch != current_branch
|
11
|
+
`git status`.include?('working directory clean') or raise 'Dirty working directory. Nothing was pushed.'
|
12
|
+
`git checkout #{branch}`
|
13
|
+
end
|
14
|
+
|
15
|
+
# push branch to remote and track it
|
16
|
+
`git push -u origin #{branch}`
|
10
17
|
|
11
18
|
puts "#{branch} is now tracking origin/#{branch}"
|
12
19
|
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04-
|
18
|
+
date: 2012-04-12 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|