Skip to content

Conversation

@jawshooah
Copy link
Collaborator

This hook guards against destructive updates to branches specified in the config.

pushed_refs is more accurate, since each push can contain multiple
commits.
Add helpers which indicate whether the ref has been created, deleted, or
force-pushed.
This hook guards against destructive updates to specified branches.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to do a regex match here? Suppose I have a branch called master-and-commander?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Better would probably be pushed_ref.remote_ref == "refs/heads/#{branch}".

@sds sds added the enhancement label Apr 6, 2015
@sds
Copy link
Owner

sds commented Apr 6, 2015

Merged in 256fe2a, thanks!

@sds sds closed this Apr 6, 2015
@jawshooah jawshooah deleted the pre-push/protected-branches branch April 6, 2015 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants