Merge branch 'maint'

* maint:
  Protect peel_ref fallback case from NULL parse_object result
  Ensure 'make dist' compiles git-archive.exe on Cygwin
This commit is contained in:
Junio C Hamano 2008-02-24 10:01:19 -08:00
commit dc31cd8fcc
2 changed files with 2 additions and 2 deletions

View File

@ -1102,7 +1102,7 @@ git.spec: git.spec.in
mv $@+ $@
GIT_TARNAME=git-$(GIT_VERSION)
dist: git.spec git-archive configure
dist: git.spec git-archive$(X) configure
./git-archive --format=tar \
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
@mkdir -p $(GIT_TARNAME)

2
refs.c
View File

@ -506,7 +506,7 @@ int peel_ref(const char *ref, unsigned char *sha1)
/* fallback - callers should not call this for unpacked refs */
o = parse_object(base);
if (o->type == OBJ_TAG) {
if (o && o->type == OBJ_TAG) {
o = deref_tag(o, ref, 0);
if (o) {
hashcpy(sha1, o->sha1);