use_push_options = 1;
hash = parse_feature_value(feature_list, "object-format", &len, NULL);
if (!hash) {
- hash = hash_algos[GIT_HASH_SHA1].name;
+ hash = hash_algos[GIT_HASH_ORIGINAL].name;
len = strlen(hash);
}
if (xstrncmpz(the_hash_algo->name, hash, len))
* by an "object-format=" capability, which is being handled in
* `parse_capability()`.
*/
- header->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ header->hash_algo = &hash_algos[GIT_HASH_ORIGINAL];
/* The bundle header ends with an empty line */
while (!strbuf_getwholeline_fd(&buf, fd, '\n') &&
* SHA1.
* 2. @filter is required because we parsed an object filter.
*/
- if (the_hash_algo != &hash_algos[GIT_HASH_SHA1] || revs.filter.choice)
+ if (the_hash_algo != &hash_algos[GIT_HASH_ORIGINAL] || revs.filter.choice)
min_version = 3;
if (argc > 1) {
reader->hash_algo = &hash_algos[hash_algo];
free(hash_name);
} else {
- reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ reader->hash_algo = &hash_algos[GIT_HASH_ORIGINAL];
}
}
reader->hash_algo = &hash_algos[hash_algo];
packet_write_fmt(fd_out, "object-format=%s", reader->hash_algo->name);
} else {
- reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ reader->hash_algo = &hash_algos[GIT_HASH_ORIGINAL];
}
if (server_feature_v2("promisor-remote", &promisor_remote_info)) {
char *reply = promisor_remote_reply(promisor_remote_info);
if (feature_supported)
*feature_supported = !!hash;
if (!hash) {
- hash = hash_algos[GIT_HASH_SHA1].name;
+ hash = hash_algos[GIT_HASH_ORIGINAL].name;
len = strlen(hash);
}
while (hash) {
die(_("mismatched algorithms: client %s; server %s"),
the_hash_algo->name, hash_name);
packet_buf_write(req_buf, "object-format=%s", the_hash_algo->name);
- } else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_SHA1) {
+ } else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_ORIGINAL) {
die(_("the server does not support algorithm '%s'"),
the_hash_algo->name);
}
reader->buffer_size = sizeof(packet_buffer);
reader->options = options;
reader->me = "git";
- reader->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ reader->hash_algo = &hash_algos[GIT_HASH_ORIGINAL];
strbuf_init(&reader->scratch, 0);
}
* back to SHA1, which may or may not be correct.
*/
if (!p)
- return &hash_algos[GIT_HASH_SHA1];
+ return &hash_algos[GIT_HASH_ORIGINAL];
algo = hash_algo_by_length((p - heads->buf) / 2);
if (algo == GIT_HASH_UNKNOWN)
static int advertise_sid = -1;
static int advertise_object_info = -1;
-static int client_hash_algo = GIT_HASH_SHA1;
+static int client_hash_algo = GIT_HASH_ORIGINAL;
static int always_advertise(struct repository *r UNUSED,
struct strbuf *value UNUSED)
* version will get adjusted by git-clone(1) once it has learned about
* the remote repository's format.
*/
- if (hash_algo != GIT_HASH_SHA1 ||
+ if (hash_algo != GIT_HASH_ORIGINAL ||
ref_storage_format != REF_STORAGE_FORMAT_FILES)
target_version = GIT_REPO_VERSION_READ;
- if (hash_algo != GIT_HASH_SHA1 && hash_algo != GIT_HASH_UNKNOWN)
+ if (hash_algo != GIT_HASH_ORIGINAL && hash_algo != GIT_HASH_UNKNOWN)
git_config_set("extensions.objectformat",
hash_algos[hash_algo].name);
else if (reinit)
ret->smart_options->receivepack = remote->receivepack;
}
- ret->hash_algo = &hash_algos[GIT_HASH_SHA1];
+ ret->hash_algo = &hash_algos[GIT_HASH_ORIGINAL];
return ret;
}