summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-11 09:29:58 -0700
committerJunio C Hamano <gitster@pobox.com>2015-06-11 09:29:59 -0700
commit43262d8d6511212f49d519779505f8a557c8dc84 (patch)
tree3a68ca86e32cb14060f97ba4e603affc263ecbdf /commit.c
parent0e04b248b5d5828b907a346e920dda4003311406 (diff)
parentce4e7b2ac38cfe5e4c165411d2e37b22e445ab88 (diff)
downloadgit-43262d8d6511212f49d519779505f8a557c8dc84.tar.gz
Merge branch 'jk/squelch-missing-link-warning-for-unreachable'
Recent "git prune" traverses young unreachable objects to safekeep old objects in the reachability chain from them, which sometimes caused error messages that are unnecessarily alarming. * jk/squelch-missing-link-warning-for-unreachable: suppress errors on missing UNINTERESTING links silence broken link warnings with revs->ignore_missing_links add quieter versions of parse_{tree,commit}
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 2d9de807ae..6e2103cef6 100644
--- a/commit.c
+++ b/commit.c
@@ -357,7 +357,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
return 0;
}
-int parse_commit(struct commit *item)
+int parse_commit_gently(struct commit *item, int quiet_on_missing)
{
enum object_type type;
void *buffer;
@@ -370,7 +370,8 @@ int parse_commit(struct commit *item)
return 0;
buffer = read_sha1_file(item->object.sha1, &type, &size);
if (!buffer)
- return error("Could not read %s",
+ return quiet_on_missing ? -1 :
+ error("Could not read %s",
sha1_to_hex(item->object.sha1));
if (type != OBJ_COMMIT) {
free(buffer);