Cannot pull with rebase error
Integralist opened this issue · comments
I've just noticed the following error...
$ voom update
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
Any ideas on where I can start to debug this? Thanks :-)
Hmm, there is absolutely no error handling anywhere in the script ;)
I should think this line is tripping up. You could move it below the echo
in the following (code) line to find out which plugin has the unstaged changes.
I suppose the correct thing to do is catch any errors when git-pulling, display them nicely to the user, and press on.
OK so I figured out it was one of my own plugins that was in a inconsistent state :-)
Annoyingly I fixed the issue and then realised I should've left it broken so I could use...
error() {
local parent_lineno="$1"
local message="$2"
local code="${3:-1}"
if [[ -n "$message" ]] ; then
echo "Error on or near line ${parent_lineno}: ${message}; exiting with status ${code}"
else
echo "Error on or near line ${parent_lineno}; exiting with status ${code}"
fi
exit "${code}"
}
trap 'error ${LINENO}' ERR
...to try and capture any errors (as I would've opened a PR for you), but now nothing's broken so decided to leave it.