summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db70a04)
raw | patch | inline | side by side (parent: db70a04)
author | Felipe Contreras <felipe.contreras@gmail.com> | |
Wed, 22 Feb 2012 22:43:40 +0000 (00:43 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 23 Feb 2012 00:08:05 +0000 (16:08 -0800) |
Will be useful in next patches. No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | patch | blob | history |
diff --git a/remote.c b/remote.c
index 4b06a11732cfc66747178d697f56ef39d7a1eb72..c3cf736600efbec2e7ceae8c45e511ba0ffb91df 100644 (file)
--- a/remote.c
+++ b/remote.c
*tail = &ref->next;
}
+static struct ref *alloc_delete_ref(void)
+{
+ struct ref *ref = alloc_ref("(delete)");
+ hashclr(ref->new_sha1);
+ return ref;
+}
+
static struct ref *try_explicit_object_name(const char *name)
{
unsigned char sha1[20];
struct ref *ref;
- if (!*name) {
- ref = alloc_ref("(delete)");
- hashclr(ref->new_sha1);
- return ref;
- }
+ if (!*name)
+ return alloc_delete_ref();
if (get_sha1(name, sha1))
return NULL;
ref = alloc_ref(name);