Commit c28c7012 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Merge branch 'hotfix/0.1.6' into develop

parents 240323e4 7f008172
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

AC_INIT([git-hooks], [0.1.5])
AC_INIT([git-hooks], [0.1.6])
AM_INIT_AUTOMAKE

gitcoredir=`git --exec-path`
+4 −12
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ build ()
{
	export PATH="/bin:/usr/bin:/usr/local/bin:$PATH"
	local ref=`_normalise_ref "$1"`
	local commit="$2"
	local confsec=`_get_config_section "$ref"`
	local dbuild=`config location || echo /tmp/build/`
	local dmax=`config max-builds || echo 4`
@@ -204,22 +205,13 @@ build ()

	# create the git repository if it does not exist
	is_git_workspace "$dir" || git clone "$GIT_DIR" "$dir" >&2
	git push "$dir" "$commit":refs/"$ref"

	# switch to build dir, clean it out & get the correct commit
	cd "$dir"
	(
		unset GIT_DIR
		remote_ref="${ref/heads/remotes/origin}"
		git fetch origin
		git fetch origin --tags
		case "${ref%%/*}" in
			heads)
				git checkout -B "${ref/heads\//}" "$remote_ref"
				;;
			*)
				git checkout -B build/ref/"$ref" "$remote_ref"
				;;
		esac
		git checkout "$commit"
		git clean -f -d -q -x
		git reset --hard
	)
@@ -285,7 +277,7 @@ main ()
			mkdir -p "$log_dir"
			[ -e "$log_current" ] && rm "$log_current" || true
			ln -s `basename "$log"` "$log_current"
			build "$ref" </dev/null &>>"$log" &
			build "$ref" "$new" </dev/null &>>"$log" &
		fi
	done
}