summaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorMatt McCutchen <matt@mattmccutchen.net>2017-02-22 16:05:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-02 19:12:53 (GMT)
commitd56583ded679f2eade3994d855c8d605e2964710 (patch)
tree0e0774cb387c973b2c97d8e9e2e06e34c3c2f382 /remote.h
parente70a65c5d89e4543491082d4b361398fd87433db (diff)
downloadgit-d56583ded679f2eade3994d855c8d605e2964710.zip
git-d56583ded679f2eade3994d855c8d605e2964710.tar.gz
git-d56583ded679f2eade3994d855c8d605e2964710.tar.bz2
fetch-pack: add specific error for fetching an unadvertised object
Enhance filter_refs (which decides whether a request for an unadvertised object should be sent to the server) to record a new match status on the "struct ref" when a request is not allowed, and have report_unmatched_refs check for this status and print a special error message, "Server does not allow request for unadvertised object". Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/remote.h b/remote.h
index 9248811..0b9d8c4 100644
--- a/remote.h
+++ b/remote.h
@@ -89,8 +89,13 @@ struct ref {
force:1,
forced_update:1,
expect_old_sha1:1,
- deletion:1,
- matched:1;
+ deletion:1;
+
+ enum {
+ REF_NOT_MATCHED = 0, /* initial value */
+ REF_MATCHED,
+ REF_UNADVERTISED_NOT_ALLOWED
+ } match_status;
/*
* Order is important here, as we write to FETCH_HEAD