Skip to content

Instantly share code, notes, and snippets.

@eval
Created February 17, 2012 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eval/1853235 to your computer and use it in GitHub Desktop.
Save eval/1853235 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
$VERBOSE=true
UNACCEPTABLE_REFNAME = /refs\/heads\/\d/
refname, oldrev, newrev = ARGV[0...3]
if oldrev[/^0{40}/] # new branch received
if refname[UNACCEPTABLE_REFNAME]
raise "Names of branches can't be of the form '#{UNACCEPTABLE_REFNAME}'"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment