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)
committerSimon McVittie <smcv@debian.org>
Tue, 3 Oct 2017 21:47:48 +0000 (22:47 +0100)
commit4e75f6969dcef612090a980a0b8313872a8f43bc
tree9327e4e8f192b5ec00a6cc7dd385dcb12400e7b1
parentf3be2260cac9e0a6d405b458c433db8c2e298fd3
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
Origin: upstream, 2017.13, commit:b8c15ae859de7a353b99c98c6266ee626cd94e7e

Gbp-Pq: Topic 2017.13
Gbp-Pq: Name lib-pull-Fix-regression-with-pull-local-for-nonexistent-r.patch
src/libostree/ostree-repo-pull.c
tests/pull-test.sh