Commit ed90f04
refs API: make resolve_ref_unsafe() not set errno
Change the resolve_ref_unsafe() wrapper function to use the underlying
refs_werrres_ref_unsafe() directly.
From a reading of the callers I determined that the only one who cared
about errno was a sequencer.c caller added in e47c6ca (commit:
move print_commit_summary() to libgit, 2017-11-24), I'm migrating it
to using refs_werrres_ref_unsafe() directly.
This adds another "set errno" instance, but in this case it's OK and
idiomatic. We are setting it just before calling die_errno(). We could
have some hypothetical die_errno_var(&saved_errno, ...) here, but I
don't think it's worth it. The problem with errno is subtle action at
distance, not this sort of thing. We already use this pattern in a
couple of places in wrapper.c
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 1e3ccb5 commit ed90f04
2 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
1788 | | - | |
1789 | | - | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1790 | 1792 | | |
1791 | 1793 | | |
1792 | 1794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1282 | 1282 | | |
1283 | 1283 | | |
1284 | 1284 | | |
| 1285 | + | |
| 1286 | + | |
1285 | 1287 | | |
1286 | 1288 | | |
1287 | 1289 | | |
| |||
1331 | 1333 | | |
1332 | 1334 | | |
1333 | 1335 | | |
1334 | | - | |
1335 | | - | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1336 | 1341 | | |
| 1342 | + | |
1337 | 1343 | | |
1338 | 1344 | | |
1339 | 1345 | | |
| |||
0 commit comments