write_refs_to_temp_dir(): convert local variable sha1 to object_id
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7290ef5898
commit
f31ba7e116
@ -299,18 +299,18 @@ static int write_one_ref(const char *name, const unsigned char *sha1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int write_refs_to_temp_dir(struct strbuf *temp_dir,
|
static int write_refs_to_temp_dir(struct strbuf *temp_dir,
|
||||||
int refspec_nr, const char **refspec)
|
int refspec_nr, const char **refspec)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < refspec_nr; i++) {
|
for (i = 0; i < refspec_nr; i++) {
|
||||||
unsigned char sha1[20];
|
struct object_id oid;
|
||||||
char *ref;
|
char *ref;
|
||||||
|
|
||||||
if (dwim_ref(refspec[i], strlen(refspec[i]), sha1, &ref) != 1)
|
if (dwim_ref(refspec[i], strlen(refspec[i]), oid.hash, &ref) != 1)
|
||||||
return error("Could not get ref %s", refspec[i]);
|
return error("Could not get ref %s", refspec[i]);
|
||||||
|
|
||||||
if (write_one_ref(ref, sha1, 0, temp_dir)) {
|
if (write_one_ref(ref, oid.hash, 0, temp_dir)) {
|
||||||
free(ref);
|
free(ref);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user