X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/6e6a673660f272f5835eb98b4d7146bf71dc46fa..6381ce658f88b2e2e8fdc4a019cebcabf1d6eb28:/mr diff --git a/mr b/mr index 69c47c6..f60ce7b 100755 --- a/mr +++ b/mr @@ -1879,6 +1879,13 @@ sub getopts { } } +sub check { + my @env = qw(GIT_DIR GIT_WORK_TREE VCSH_COMMAND); + foreach (@env) { + die ("mr: environment variable '$_' is set. You are about to shoot your own foot.\n") if ($ENV{$_}); + } +} + sub init { $SIG{INT}=sub { print STDERR "mr: interrupted\n"; @@ -1914,6 +1921,7 @@ sub exitstats { sub main { getopts(); + check(); init(); help(@ARGV) if $ARGV[0] eq 'help'; @@ -2069,7 +2077,7 @@ fossil_clean = else fossil clean --force --dotfiles --emptydirs "$@" fi -vcsh_commit = +vcsh_clean = if [ "x$1" = x-f ] ; then shift vcsh run "$MR_REPO" git clean -dx "$@"