Skip to content
This repository
Browse code

Update feature.rb with new Git::run_safe

  • Loading branch information...
commit 6db03acbf650e0bef350b4c55b25de8679928bbb 1 parent 748e835
Daniel Beardsley authored March 16, 2012

Showing 1 changed file with 22 additions and 17 deletions. Show diff stats Hide diff stats

  1. 39  feature.rb
39  feature.rb
@@ -11,12 +11,14 @@
11 11
 
12 12
    exit if !confirm("Create feaure branch named: '#{feature}' ?")
13 13
 
14  
-   Git::run_safe("git branch \"#{feature}\" master")
15  
-   Git::run_safe("git checkout \"#{feature}\"")
16  
-   # Automatically setup remote tracking branch
17  
-   Git::run_safe("git config branch.#{feature}.remote origin")
18  
-   Git::run_safe("git config branch.#{feature}.merge refs/heads/#{feature}")
19  
-   Git::run_safe("git config branch.#{feature}.rebase true")
  14
+   Git::run_safe([
  15
+      "git branch \"#{feature}\" master",
  16
+      "git checkout \"#{feature}\"",
  17
+      # Automatically setup remote tracking branch
  18
+      "git config branch.#{feature}.remote origin",
  19
+      "git config branch.#{feature}.merge refs/heads/#{feature}",
  20
+      "git config branch.#{feature}.rebase true"
  21
+   ])
20 22
 
21 23
    puts "Successfully created a new feature-branch: #{feature}"
22 24
 
@@ -63,17 +65,20 @@
63 65
 
64 66
    exit 1 if !confirm("Finish feaure branch named: '#{feature}' ?")
65 67
 
66  
-   Git::run_safe("git checkout master")
67  
-   # pull the latest changes and rebase the unpushed master commits if any.
68  
-   Git::run_safe("git pull --rebase")
69  
-   # merge the feature branch into master
70  
-   Git::run_safe("git merge --no-ff  \"#{feature}\"")
71  
-   # delete the local feature-branch
72  
-   Git::run_safe("git branch -d \"#{feature}\"")
73  
-   # delete the remote branch we'll leave this off for now
74  
-   # Git::run_safe("git push origin :\"#{feature}\"")
75  
-   # push the the merge to our origin
76  
-   # Git::run_safe("git push origin")
  68
+   commands = [
  69
+      "git checkout master",
  70
+      # pull the latest changes and rebase the unpushed master commits if any.
  71
+      "git pull --rebase",
  72
+      # merge the feature branch into master
  73
+      "git merge --no-ff  \"#{feature}\"",
  74
+      # delete the local feature-branch
  75
+      "git branch -d \"#{feature}\"",
  76
+      # delete the remote branch we'll leave this off for now
  77
+      #"git push origin :\"#{feature}\"",
  78
+      # push the the merge to our origin
  79
+      #"git push origin",
  80
+   ]
  81
+   Git::run_safe(commands)
77 82
 
78 83
    puts "Successfully merged feature-branch: #{feature} into master"
79 84
 

0 notes on commit 6db03ac

Please sign in to comment.
Something went wrong with that request. Please try again.