summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ff74f7f)
raw | patch | inline | side by side (parent: ff74f7f)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Oct 2011 20:45:50 +0000 (13:45 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Oct 2011 20:58:15 +0000 (13:58 -0700) |
Instead of keeping this as an internal API, let the callers find
out the reason why resolve_ref() returned NULL is not because there
was no such file in $GIT_DIR but because a file was corrupt.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
out the reason why resolve_ref() returned NULL is not because there
was no such file in $GIT_DIR but because a file was corrupt.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c | patch | blob | history | |
refs.h | patch | blob | history |
index e3692bd3d8cec6a03721bbda91466bfca34b8783..30e08482a076c3a878588f93b7be680e891fbe12 100644 (file)
--- a/refs.c
+++ b/refs.c
#include "tag.h"
#include "dir.h"
-/* ISSYMREF=01 and ISPACKED=02 are public interfaces */
-#define REF_KNOWS_PEELED 04
-#define REF_BROKEN 010
+/* ISSYMREF=0x01, ISPACKED=0x02 and ISBROKEN=0x04 are public interfaces */
+#define REF_KNOWS_PEELED 0x10
struct ref_list {
struct ref_list *next;
flag = 0;
if (resolve_gitlink_ref(submodule, ref, sha1) < 0) {
hashclr(sha1);
- flag |= REF_BROKEN;
+ flag |= REF_ISBROKEN;
}
} else
if (!resolve_ref(ref, sha1, 1, &flag)) {
hashclr(sha1);
- flag |= REF_BROKEN;
+ flag |= REF_ISBROKEN;
}
list = add_ref(ref, sha1, flag, list, NULL);
}
return 0;
if (!(flags & DO_FOR_EACH_INCLUDE_BROKEN)) {
- if (entry->flag & REF_BROKEN)
- return 0; /* ignore dangling symref */
+ if (entry->flag & REF_ISBROKEN)
+ return 0; /* ignore broken refs e.g. dangling symref */
if (!has_sha1_file(entry->sha1)) {
error("%s does not point to a valid object!", entry->name);
return 0;
index d5ac133336dc0da45cd916207d12a5e0e4237ae3..e4578856d7c2425ac26df025e1027198f9cb63a5 100644 (file)
--- a/refs.h
+++ b/refs.h
int force_write;
};
-#define REF_ISSYMREF 01
-#define REF_ISPACKED 02
+#define REF_ISSYMREF 0x01
+#define REF_ISPACKED 0x02
+#define REF_ISBROKEN 0x04
/*
* Calls the specified function for each ref file until it returns nonzero,