lib/pull: Fix regression with pull-local for nonexistent refs
authorColin Walters <walters@verbum.org>
Mon, 2 Oct 2017 15:24:05 +0000 (11:24 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 2 Oct 2017 16:02:28 +0000 (16:02 +0000)
commitb8c15ae859de7a353b99c98c6266ee626cd94e7e
tree6767f93e24afcff54b6191fa659885f9ae3ac83d
parent06c731bfa326798a70b0115a7f348b9ebbdf63da
lib/pull: Fix regression with pull-local for nonexistent refs

I was reading the pull code for the last release, and spotted
a bug in commit f923c2e1eaebe0c781f07d34ae1a03f94357bccd - in
the case where the ref doesn't exist, we don't set an error,
tripping an assertion in the main code.

The previous code wanted the ref to always exist, so just flip back the boolean
for "ignore noent". I moved the `g_strchomp()` just into the HTTP path - if a
local repo is corrupted in this way it's something to fix in that repo.

Closes: #1238
Approved by: pwithnall
src/libostree/ostree-repo-pull.c
tests/pull-test.sh