[PATCH] Update git-clone documentation
[git.git] / sha1_file.c
index 6638202..895c1fa 100644 (file)
@@ -20,6 +20,8 @@
 #endif
 #endif
 
+const unsigned char null_sha1[20] = { 0, };
+
 static unsigned int sha1_file_open_flag = O_NOATIME;
 
 static unsigned hexval(char c)
@@ -70,6 +72,13 @@ static void setup_git_env(void)
                git_graft_file = strdup(git_path("info/grafts"));
 }
 
+char *get_git_dir(void)
+{
+       if (!git_dir)
+               setup_git_env();
+       return git_dir;
+}
+
 char *get_object_directory(void)
 {
        if (!git_object_dir)
@@ -864,7 +873,8 @@ void packed_object_info_detail(struct pack_entry *e,
                strcpy(type, "tag");
                break;
        default:
-               die("corrupted pack file");
+               die("corrupted pack file %s containing object of kind %d",
+                   p->pack_name, kind);
        }
        *store_size = 0; /* notyet */
 }
@@ -903,7 +913,8 @@ static int packed_object_info(struct pack_entry *entry,
                strcpy(type, "tag");
                break;
        default:
-               die("corrupted pack file");
+               die("corrupted pack file %s containing object of kind %d",
+                   p->pack_name, kind);
        }
        if (sizep)
                *sizep = size;
@@ -1003,7 +1014,7 @@ static void *unpack_entry(struct pack_entry *entry,
        retval = unpack_entry_gently(entry, type, sizep);
        unuse_packed_git(p);
        if (!retval)
-               die("corrupted pack file");
+               die("corrupted pack file %s", p->pack_name);
        return retval;
 }