From 3769c7ccb6a7f0089bb44c0e061a321aa2f4815e Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12-RIPE)" Date: Sat, 5 Nov 2016 23:37:33 +0100 Subject: [PATCH] Remove the debug die at startup. :( --- run_branches | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/run_branches b/run_branches index 9e267af..20f3790 100755 --- a/run_branches +++ b/run_branches @@ -72,6 +72,25 @@ $branch = 'global'; # require $buildconf; +# Check if auto-update is wanted and possible +if (not exists $EximBuild::Conf{auto_update} or $EximBuild::Conf{auto_update}) +{ + die "$0: auto-update not possible: need write permissions in @{[cwd]}\n" + if not -w '.'; + # http://stackoverflow.com/questions/3258243/check-if-pull-needed-in-git + system('git remote update') == 0 or die $? >> 8; + my ($upstream, $local, $base) = qx'git rev-parse ...@{upstream}'; die $? >> 8 if $?; + $base =~ s/^\^//; + + if ($upstream ne $local) { + die "$0: the merge base is not local anymore. Refusing to `git pull`\n" + if $base ne $local; + + # if we're the merge base, the ff-only should workkkkkk + system 'git pull --ff-only' + } +} + unless ( ( ref $EximBuild::conf{branches_to_build} eq 'ARRAY' -- 2.30.2