From 6c0f86943e9ebba5aa281772e01559773e0c1234 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 24 Feb 2008 00:38:04 -0500 Subject: Ensure 'make dist' compiles git-archive.exe on Cygwin On Cygwin we have to use git-archive.exe as the target, otherwise running 'make dist' does not compile git-archive in the current directory. That may cause 'make dist' to fail on a clean source tree that has never been built before. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 92341c4..7a3c6d1 100644 --- a/Makefile +++ b/Makefile @@ -1087,7 +1087,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) -- cgit v0.10.2-6-g49f6 From 8c87dc77ae45d7277001b1be2c88ea9062e11d72 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 24 Feb 2008 03:07:19 -0500 Subject: Protect peel_ref fallback case from NULL parse_object result If the SHA-1 we are requesting the object for does not exist in the object database we get a NULL back. Accessing the type from that is not likely to succeed on any system. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano diff --git a/refs.c b/refs.c index 67d2a50..fb33da1 100644 --- a/refs.c +++ b/refs.c @@ -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); -- cgit v0.10.2-6-g49f6