HomeFreeBSD

git-arc: Globally save and restore the git checkout head

Description

git-arc: Globally save and restore the git checkout head

This script uses -e, so it's prone to exiting in awkward places. In
particular, if arc diff fails, the script just exits without restoring
the checkout.

Mitigate this for now by using a global variable to record the previous
checkout and use a trap handler to restore it in the face of errors. A
better solution might be to use arc diff's --head parameter but that
will require more testing.

Reported by: kevans
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28631

Details

Provenance
markjAuthored on Feb 18 2021, 3:59 PM
Reviewer
jhb
Differential Revision
D28631: git-arc: Globally save and restore the git checkout head
Parents
rG9976b42b697c: ddb: fix show devmap output on 32-bit arm
Branches
Unknown
Tags
Unknown