diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-09-11 20:10:15 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-09-17 19:09:11 -0700 |
commit | b37a562a1097af7403c649a5f903a93acaf279e8 (patch) | |
tree | 1ba2c642fa6bc94484876d58d8848c48e5fd274b | |
parent | e1e22e37f47e3f4d741d28920e1d27e3775c31ad (diff) | |
download | git-b37a562a1097af7403c649a5f903a93acaf279e8.tar.gz git-b37a562a1097af7403c649a5f903a93acaf279e8.tar.xz |
Add support for negative refs
You can remove a ref that is packed two different ways: either simply
repack all the refs without that one, or create a loose ref that has the
magic all-zero SHA1.
This also adds back the test that a ref actually has the object it
points to.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | refs.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -280,6 +280,12 @@ static int do_for_each_ref(const char *base, int (*fn)(const char *path, const u } if (strncmp(base, entry->name, trim)) continue; + if (is_null_sha1(entry->sha1)) + continue; + if (!has_sha1_file(entry->sha1)) { + error("%s does not point to a valid object!", entry->name); + continue; + } retval = fn(entry->name + trim, entry->sha1); if (retval) return retval; |