chiark / gitweb /
dgit: clone multisuite works even without --no-rm-on-error.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Jul 2017 20:11:52 +0000 (21:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Jul 2017 20:11:53 +0000 (21:11 +0100)
commit37679efe82686b5fb1ba4d198c6df41a9e1fa52d
tree36341a3fdca2fea0ec437e4876b296668243d621
parent9dbb304f9a8405bd7b93e26c6603fd9883bd598e
dgit: clone multisuite works even without --no-rm-on-error.

This is slightly subtle.

We need $rmonerror in cmd_clone to be cleared.  cmd_clone does that
only when clone itself returns.  The multisuite plumbing means that
currently, clone returns only in the child which set up the tree and
set up the first suite.  Unsetting $rmonerror there is correct because
we want to keep the tree on success, and the parent will remove it if
there is a later failure.  (Ie, the child remains responsible for
removing the tree if it itself fails.)

In the parent, we get $multi_fetched==1 if not only our original clone
child succeeded, but all the other fetches worked too.  We are now
responsible for the tree.  If our final tasks are successful, again,
we need not to delete the tree.

Closes:#867434.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit