Commit 968998e6 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

sync-all : Warn on 'pull' operation if not on master branch.

parent 3cd1360f
......@@ -551,6 +551,18 @@ sub gitall {
unlink "resume";
}
sub checkCurrentBranchIsMaster {
my $branch = `git symbolic-ref HEAD`;
$branch =~ s/refs\/heads\///;
$branch =~ s/\n//;
if ($branch !~ /master/) {
print "\nWarning: You trying to 'pull' while on branch '$branch'.\n"
. "Updates to this script will happen on the master branch which\n"
. "means the version on this branch may be out of date.\n\n";
}
}
sub help
{
my $exit = shift;
......@@ -889,6 +901,9 @@ sub main {
}
BEGIN {
if ("pull" ~~ @ARGV) {
checkCurrentBranchIsMaster();
}
$initial_working_directory = getcwd();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment