Commit 24ce105b40caaed209936e6481ed2fa801f5fd7d

Vicent Martí 2011-10-03T14:42:52

Merge pull request #441 from csware/ignore-missing-pack-file ignore missing pack file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 4607fb7..a8f8542 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -224,7 +224,10 @@ static int packfile_load__cb(void *_data, char *path)
 	}
 
 	error = git_packfile_check(&pack, path);
-	if (error < GIT_SUCCESS)
+	if (error == GIT_ENOTFOUND) {
+		/* ignore missing .pack file as git does */
+		return GIT_SUCCESS;
+	} else if (error < GIT_SUCCESS)
 		return git__rethrow(error, "Failed to load packfile");
 
 	if (git_vector_insert(&backend->packs, pack) < GIT_SUCCESS) {