summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-04-26 01:06:23 (GMT)
committerMichael Haggerty <mhagger@alum.mit.edu>2016-06-13 09:23:49 (GMT)
commit3a0b6b9aba844075e802a6dc4c24622b34ab535b (patch)
treeb076c1b457510205ae4d2666472f93ca21ad5e18 /refs
parentefe472813d60befd72d6e2797934c90b22a26c93 (diff)
downloadgit-3a0b6b9aba844075e802a6dc4c24622b34ab535b.zip
git-3a0b6b9aba844075e802a6dc4c24622b34ab535b.tar.gz
git-3a0b6b9aba844075e802a6dc4c24622b34ab535b.tar.bz2
read_raw_ref(): rename flags argument to type
This will hopefully reduce confusion with the "flags" arguments that are used in many functions in this module as an input parameter to choose how the function should operate. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c18
-rw-r--r--refs/refs-internal.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 814e230..1657ce7 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1395,18 +1395,18 @@ static int resolve_missing_loose_ref(const char *refname,
*
* If the ref is symbolic, fill in *symref with the referrent
* (e.g. "refs/heads/master") and return 0. The caller is responsible
- * for validating the referrent. Set REF_ISSYMREF in flags.
+ * for validating the referrent. Set REF_ISSYMREF in type.
*
* If the ref doesn't exist, set errno to ENOENT and return -1.
*
* If the ref exists but is neither a symbolic ref nor a sha1, it is
- * broken. Set REF_ISBROKEN in flags, set errno to EINVAL, and return
+ * broken. Set REF_ISBROKEN in type, set errno to EINVAL, and return
* -1.
*
* If there is another error reading the ref, set errno appropriately and
* return -1.
*
- * Backend-specific flags might be set in flags as well, regardless of
+ * Backend-specific flags might be set in type as well, regardless of
* outcome.
*
* sb_path is workspace: the caller should allocate and free it.
@@ -1419,7 +1419,7 @@ static int resolve_missing_loose_ref(const char *refname,
* refname will still be valid and unchanged.
*/
int read_raw_ref(const char *refname, unsigned char *sha1,
- struct strbuf *symref, unsigned int *flags)
+ struct strbuf *symref, unsigned int *type)
{
struct strbuf sb_contents = STRBUF_INIT;
struct strbuf sb_path = STRBUF_INIT;
@@ -1448,7 +1448,7 @@ stat_ref:
if (lstat(path, &st) < 0) {
if (errno != ENOENT)
goto out;
- if (resolve_missing_loose_ref(refname, sha1, flags)) {
+ if (resolve_missing_loose_ref(refname, sha1, type)) {
errno = ENOENT;
goto out;
}
@@ -1469,7 +1469,7 @@ stat_ref:
if (starts_with(sb_contents.buf, "refs/") &&
!check_refname_format(sb_contents.buf, 0)) {
strbuf_swap(&sb_contents, symref);
- *flags |= REF_ISSYMREF;
+ *type |= REF_ISSYMREF;
ret = 0;
goto out;
}
@@ -1482,7 +1482,7 @@ stat_ref:
* ref is supposed to be, there could still be a
* packed ref:
*/
- if (resolve_missing_loose_ref(refname, sha1, flags)) {
+ if (resolve_missing_loose_ref(refname, sha1, type)) {
errno = EISDIR;
goto out;
}
@@ -1519,7 +1519,7 @@ stat_ref:
strbuf_reset(symref);
strbuf_addstr(symref, buf);
- *flags |= REF_ISSYMREF;
+ *type |= REF_ISSYMREF;
ret = 0;
goto out;
}
@@ -1530,7 +1530,7 @@ stat_ref:
*/
if (get_sha1_hex(buf, sha1) ||
(buf[40] != '\0' && !isspace(buf[40]))) {
- *flags |= REF_ISBROKEN;
+ *type |= REF_ISBROKEN;
errno = EINVAL;
goto out;
}
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 3a4f634..0b047f6 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -210,6 +210,6 @@ int do_for_each_ref(const char *submodule, const char *base,
each_ref_fn fn, int trim, int flags, void *cb_data);
int read_raw_ref(const char *refname, unsigned char *sha1,
- struct strbuf *symref, unsigned int *flags);
+ struct strbuf *symref, unsigned int *type);
#endif /* REFS_REFS_INTERNAL_H */