diff mbox series

[1/3] Make refs_ref_exists public

Message ID 5e29fa74dc70b5e36ace27ed6d83060cf0925681.1597753075.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series Use refs API for handling sundry pseudorefs | expand

Commit Message

Philippe Blain via GitGitGadget Aug. 18, 2020, 12:17 p.m. UTC
From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 refs.c | 2 +-
 refs.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Junio C Hamano Aug. 18, 2020, 8:39 p.m. UTC | #1
"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> Subject: Re: [PATCH 1/3] Make refs_ref_exists public

Documentation/SubmittingPatches[[describe-changes]]

Applies to all three patches and probably other recent topics from
you.

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  refs.c | 2 +-
>  refs.h | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index cf91711968..d46080f4b6 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -313,7 +313,7 @@ int read_ref(const char *refname, struct object_id *oid)
>  	return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
>  }
>  
> -static int refs_ref_exists(struct ref_store *refs, const char *refname)
> +int refs_ref_exists(struct ref_store *refs, const char *refname)
>  {
>  	return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
>  }
> diff --git a/refs.h b/refs.h
> index 29e28124cd..04bd25019f 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -105,6 +105,8 @@ int refs_verify_refname_available(struct ref_store *refs,
>  				  const struct string_list *skip,
>  				  struct strbuf *err);
>  
> +int refs_ref_exists(struct ref_store *refs, const char *refname);
> +
>  int ref_exists(const char *refname);
>  
>  int should_autocreate_reflog(const char *refname);
diff mbox series

Patch

diff --git a/refs.c b/refs.c
index cf91711968..d46080f4b6 100644
--- a/refs.c
+++ b/refs.c
@@ -313,7 +313,7 @@  int read_ref(const char *refname, struct object_id *oid)
 	return read_ref_full(refname, RESOLVE_REF_READING, oid, NULL);
 }
 
-static int refs_ref_exists(struct ref_store *refs, const char *refname)
+int refs_ref_exists(struct ref_store *refs, const char *refname)
 {
 	return !!refs_resolve_ref_unsafe(refs, refname, RESOLVE_REF_READING, NULL, NULL);
 }
diff --git a/refs.h b/refs.h
index 29e28124cd..04bd25019f 100644
--- a/refs.h
+++ b/refs.h
@@ -105,6 +105,8 @@  int refs_verify_refname_available(struct ref_store *refs,
 				  const struct string_list *skip,
 				  struct strbuf *err);
 
+int refs_ref_exists(struct ref_store *refs, const char *refname);
+
 int ref_exists(const char *refname);
 
 int should_autocreate_reflog(const char *refname);