Skip to content

Commit

Permalink
knife-spork: git plugin improvements
Browse files Browse the repository at this point in the history
We should be able to push to the branch the user is currently on instead of master by default.

This will allow users to use the branch they are on instead of a hard-coded branch that is the same for each push.
  • Loading branch information
Zackary Maupin committed Nov 7, 2019
1 parent fee7f52 commit 5af5e51
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/knife-spork/plugins/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ def after_promote_local
git_add(environment_path,"#{environment}.json")
end
if config.auto_push
branch = if not config.branch.nil?
config[:branch]
else
"master"
end

git_commit(environment_path, "promote #{cookbooks.collect{ |c| "#{c.name}@#{c.version}" }.join(",")} to #{environments.join(",")}")
git_push(branch)
end
Expand Down Expand Up @@ -380,7 +374,7 @@ def remote
end

def branch
config.branch || 'master'
config.branch || `git rev-parse --abbrev-ref HEAD`
end

def tag_name
Expand Down

0 comments on commit 5af5e51

Please sign in to comment.