Commit ef18119
refs API: add a version of refs_resolve_ref_unsafe() with "errno"
Add a new refs_werrres_ref_unsafe() function, which is like
refs_resolve_ref_unsafe() except that it explicitly saves away the
"errno" to a passed-in parameter, the refs_resolve_ref_unsafe() then
becomes a wrapper for it.
In subsequent commits we'll migrate code over to it, before finally
making "refs_resolve_ref_unsafe()" with an "errno" parameter the
canonical version, so this this function exists only so that we can
incrementally migrate callers, it will be going away in a subsequent
commit.
As the added comment notes has a rather tortured name to be the same
length as "refs_resolve_ref_unsafe", to avoid churn as we won't need
to re-indent the argument lists, similarly the documentation and
structure of it in refs.h is designed to minimize a diff in a
subsequent commit, where that documentation will be added to the new
refs_resolve_ref_unsafe().
At the end of this migration the "meaningful errno" TODO item left in
76d70dc (refs.c: make resolve_ref_unsafe set errno to something
meaningful on error, 2014-06-20) will be resolved.
As can be seen from the use of refs_read_raw_ref() we'll also need to
convert some functions that the new refs_werrres_ref_unsafe() itself
calls to take this "failure_errno". That will be done in subsequent
commits.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent aa30fe1 commit ef18119
2 files changed
+39
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
1683 | | - | |
| 1682 | + | |
1684 | 1683 | | |
1685 | 1684 | | |
1686 | | - | |
| 1685 | + | |
| 1686 | + | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
1691 | 1691 | | |
1692 | 1692 | | |
| 1693 | + | |
| 1694 | + | |
1693 | 1695 | | |
1694 | 1696 | | |
1695 | 1697 | | |
| |||
1700 | 1702 | | |
1701 | 1703 | | |
1702 | 1704 | | |
1703 | | - | |
| 1705 | + | |
1704 | 1706 | | |
1705 | 1707 | | |
1706 | 1708 | | |
| |||
1718 | 1720 | | |
1719 | 1721 | | |
1720 | 1722 | | |
| 1723 | + | |
1721 | 1724 | | |
1722 | 1725 | | |
1723 | 1726 | | |
| 1727 | + | |
| 1728 | + | |
1724 | 1729 | | |
1725 | 1730 | | |
1726 | 1731 | | |
| |||
1731 | 1736 | | |
1732 | 1737 | | |
1733 | 1738 | | |
1734 | | - | |
1735 | | - | |
1736 | | - | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
1737 | 1742 | | |
1738 | 1743 | | |
1739 | 1744 | | |
| |||
1760 | 1765 | | |
1761 | 1766 | | |
1762 | 1767 | | |
1763 | | - | |
| 1768 | + | |
1764 | 1769 | | |
1765 | 1770 | | |
1766 | 1771 | | |
1767 | 1772 | | |
1768 | 1773 | | |
1769 | 1774 | | |
1770 | 1775 | | |
1771 | | - | |
| 1776 | + | |
1772 | 1777 | | |
1773 | 1778 | | |
1774 | 1779 | | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
1775 | 1793 | | |
1776 | 1794 | | |
1777 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
14 | 26 | | |
15 | 27 | | |
16 | 28 | | |
| |||
0 commit comments