From: Ian Jackson Date: Thu, 21 Jun 2018 00:00:41 +0000 (+0100) Subject: dgit: Non-noop git fetch is not available with --dry-run, so fail X-Git-Tag: archive/debian/5.2~12 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=1967603885cd0fe76230fdfa9c026238da6c12a9;ds=sidebyside dgit: Non-noop git fetch is not available with --dry-run, so fail When fetch or push wants git fetch (other than in a situation where it happes to be a noop) but --dry-run was specified, we would loop with a false coplaint about git fetch. False, because we didn't actually run git fetch so of course it didn't do anything. Instead, fail with an explanation. Closes:#871317. This does not occur, and we do not fail, if git-fetch would be a no-op. We can tell when this is the case, because we use git-ls-remote too. This leads to one suggestion for a workaround for the user, which is to do a not --dry-run fetch first. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index 3216e4aa..2c305561 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,10 @@ dgit (5.2~) unstable; urgency=medium Closes:#883340. * When quilt fixup fails because of discrepancies, print a git diff rune which will show them. Closes:#865446. + * When fetch or push wants git fetch (other than in a situation where it + happes to be a noop) but --dry-run was specified, fail with an + explanation, rather than looping with a false coplaint about git + fetch. Closes:#871317. -- diff --git a/dgit b/dgit index 961d9748..3409e18d 100755 --- a/dgit +++ b/dgit @@ -2757,6 +2757,11 @@ END my $want = $wantr{$rrefname}; next if $got eq $want; if (!defined $objgot{$want}) { + fail <