summaryrefslogtreecommitdiff
path: root/remote-testsvn.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-05-30 17:30:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-02 00:36:06 (GMT)
commit5ee8a954e0191be2a144afdda6e37ef776730246 (patch)
tree65d17044e181df1d635870d630086f249df84dde /remote-testsvn.c
parentbb7e4739712e3f9eee0dfd60088b6d8983067960 (diff)
downloadgit-5ee8a954e0191be2a144afdda6e37ef776730246.zip
git-5ee8a954e0191be2a144afdda6e37ef776730246.tar.gz
git-5ee8a954e0191be2a144afdda6e37ef776730246.tar.bz2
notes: convert some accessor functions to struct object_id
Convert add_note, get_note, and copy_note to take struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-testsvn.c')
-rw-r--r--remote-testsvn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/remote-testsvn.c b/remote-testsvn.c
index 017af1b..8e8d5c7 100644
--- a/remote-testsvn.c
+++ b/remote-testsvn.c
@@ -51,7 +51,7 @@ static void terminate_batch(void)
}
/* NOTE: 'ref' refers to a git reference, while 'rev' refers to a svn revision. */
-static char *read_ref_note(const unsigned char sha1[20])
+static char *read_ref_note(const struct object_id *oid)
{
const struct object_id *note_oid;
char *msg = NULL;
@@ -59,7 +59,7 @@ static char *read_ref_note(const unsigned char sha1[20])
enum object_type type;
init_notes(NULL, notes_ref, NULL, 0);
- if (!(note_oid = get_note(NULL, sha1)))
+ if (!(note_oid = get_note(NULL, oid)))
return NULL; /* note tree not found */
if (!(msg = read_sha1_file(note_oid->hash, &type, &msglen)))
error("Empty notes tree. %s", notes_ref);
@@ -174,15 +174,15 @@ static int cmd_import(const char *line)
int code;
int dumpin_fd;
char *note_msg;
- unsigned char head_sha1[20];
+ struct object_id head_oid;
unsigned int startrev;
struct child_process svndump_proc = CHILD_PROCESS_INIT;
const char *command = "svnrdump";
- if (read_ref(private_ref, head_sha1))
+ if (read_ref(private_ref, head_oid.hash))
startrev = 0;
else {
- note_msg = read_ref_note(head_sha1);
+ note_msg = read_ref_note(&head_oid);
if(note_msg == NULL) {
warning("No note found for %s.", private_ref);
startrev = 0;