aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index edd20044c..91c2af78b 100644
--- a/refs.c
+++ b/refs.c
@@ -583,6 +583,9 @@ static int write_pseudoref(const char *pseudoref, const struct object_id *oid,
struct strbuf buf = STRBUF_INIT;
int ret = -1;
+ if (!oid)
+ return 0;
+
strbuf_addf(&buf, "%s\n", oid_to_hex(oid));
filename = git_path("%s", pseudoref);