chiark / gitweb /
dgit: Non-noop git fetch is not available with --dry-run, so fail
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 961d974882fc568ef6b6061af805c0f2e99ab80f..3409e18df6a9d773fed86ee4ebcf32cc43720f8d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2757,6 +2757,11 @@ END
            my $want = $wantr{$rrefname};
            next if $got eq $want;
            if (!defined $objgot{$want}) {
+               fail <<END unless act_local();
+--dry-run specified but we actually wanted the results of git fetch,
+so this is not going to work.  Try running dgit fetch first,
+or using --damp-run instead of --dry-run.
+END
                print STDERR <<END;
 warning: git ls-remote suggests we want $lrefname
 warning:  and it should refer to $want