summaryrefslogtreecommitdiff
path: root/sync-all
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-08-05 11:22:04 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-08-05 11:23:22 +1000
commit968998e69a745e38a47f4771a3244008f19ebc4a (patch)
tree2a42a55ea22f02c5d54c5d5b5a6b091fa474a659 /sync-all
parent3cd1360f05e5f2052cb5671195f8668446fae550 (diff)
downloadhaskell-968998e69a745e38a47f4771a3244008f19ebc4a.tar.gz
sync-all : Warn on 'pull' operation if not on master branch.
Diffstat (limited to 'sync-all')
-rwxr-xr-xsync-all15
1 files changed, 15 insertions, 0 deletions
diff --git a/sync-all b/sync-all
index fc629df7a9..00d14bb0a3 100755
--- a/sync-all
+++ b/sync-all
@@ -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();
}