diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-08-15 14:26:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-15 13:23:18 -0700 |
commit | c09b71ccc45f4be3acca5e809a18a000cae09faf (patch) | |
tree | 2e9bb24d66d096356a792db18b12cf995bb6cff1 | |
parent | 0e3c339bb69670b39161838de17f440480e1358a (diff) | |
download | git-c09b71ccc45f4be3acca5e809a18a000cae09faf.tar.gz git-c09b71ccc45f4be3acca5e809a18a000cae09faf.tar.xz |
receive-pack: do not reuse old_sha1[] for other things
This piece of code reads object names of shallow boundaries, not
old_sha1[], i.e. the current value the ref points at, which is to be
replaced by what is in new_sha1[].
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/receive-pack.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index a91eec8b1..c9b92bffd 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -847,9 +847,11 @@ static struct command *read_head_info(struct sha1_array *shallow) break; if (len == 48 && starts_with(line, "shallow ")) { - if (get_sha1_hex(line + 8, old_sha1)) - die("protocol error: expected shallow sha, got '%s'", line + 8); - sha1_array_append(shallow, old_sha1); + unsigned char sha1[20]; + if (get_sha1_hex(line + 8, sha1)) + die("protocol error: expected shallow sha, got '%s'", + line + 8); + sha1_array_append(shallow, sha1); continue; } |