git_repository *repo;
git_commit *commit;
git_oid tree_id, parent_id, commit_id;
- const git_signature *author, *committer;
+ git_signature *author, *committer;
+ const git_signature *author1, *committer1;
git_commit *parent;
git_tree *tree;
git_object_close((git_object *)parent);
git_object_close((git_object *)tree);
- git_signature_free((git_signature *)committer);
- git_signature_free((git_signature *)author);
+ git_signature_free(committer);
+ git_signature_free(author);
must_pass(git_commit_lookup(&commit, repo, &commit_id));
/* Check attributes were set correctly */
- author = git_commit_author(commit);
- must_be_true(author != NULL);
- must_be_true(strcmp(author->name, COMMITTER_NAME) == 0);
- must_be_true(strcmp(author->email, COMMITTER_EMAIL) == 0);
- must_be_true(author->when.time == 987654321);
- must_be_true(author->when.offset == 90);
-
- committer = git_commit_committer(commit);
- must_be_true(committer != NULL);
- must_be_true(strcmp(committer->name, COMMITTER_NAME) == 0);
- must_be_true(strcmp(committer->email, COMMITTER_EMAIL) == 0);
- must_be_true(committer->when.time == 123456789);
- must_be_true(committer->when.offset == 60);
+ author1 = git_commit_author(commit);
+ must_be_true(author1 != NULL);
+ must_be_true(strcmp(author1->name, COMMITTER_NAME) == 0);
+ must_be_true(strcmp(author1->email, COMMITTER_EMAIL) == 0);
+ must_be_true(author1->when.time == 987654321);
+ must_be_true(author1->when.offset == 90);
+
+ committer1 = git_commit_committer(commit);
+ must_be_true(committer1 != NULL);
+ must_be_true(strcmp(committer1->name, COMMITTER_NAME) == 0);
+ must_be_true(strcmp(committer1->email, COMMITTER_EMAIL) == 0);
+ must_be_true(committer1->when.time == 123456789);
+ must_be_true(committer1->when.offset == 60);
must_be_true(strcmp(git_commit_message(commit), COMMIT_MESSAGE) == 0);
git_commit *commit;
git_oid tree_id, commit_id;
const git_oid *branch_oid;
- const git_signature *author, *committer;
+ git_signature *author, *committer;
const char *branch_name = "refs/heads/root-commit-branch";
git_reference *head, *branch;
char *head_old;
0));
git_object_close((git_object *)tree);
- git_signature_free((git_signature *)committer);
- git_signature_free((git_signature *)author);
+ git_signature_free(committer);
+ git_signature_free(author);
/*
* The fact that creating a commit works has already been
git_repository *repo;
git_tag *tag;
git_oid target_id, tag_id;
- const git_signature *tagger;
+ git_signature *tagger;
+ const git_signature *tagger1;
git_reference *ref_tag;
git_object *target;
0));
git_object_close(target);
- git_signature_free((git_signature *)tagger);
+ git_signature_free(tagger);
must_pass(git_tag_lookup(&tag, repo, &tag_id));
must_be_true(git_oid_cmp(git_tag_target_oid(tag), &target_id) == 0);
/* Check attributes were set correctly */
- tagger = git_tag_tagger(tag);
- must_be_true(tagger != NULL);
- must_be_true(strcmp(tagger->name, TAGGER_NAME) == 0);
- must_be_true(strcmp(tagger->email, TAGGER_EMAIL) == 0);
- must_be_true(tagger->when.time == 123456789);
- must_be_true(tagger->when.offset == 60);
+ tagger1 = git_tag_tagger(tag);
+ must_be_true(tagger1 != NULL);
+ must_be_true(strcmp(tagger1->name, TAGGER_NAME) == 0);
+ must_be_true(strcmp(tagger1->email, TAGGER_EMAIL) == 0);
+ must_be_true(tagger1->when.time == 123456789);
+ must_be_true(tagger1->when.offset == 60);
must_be_true(strcmp(git_tag_message(tag), TAGGER_MESSAGE) == 0);
BEGIN_TEST(write2, "Attempt to write a tag bearing the same name than an already existing tag")
git_repository *repo;
git_oid target_id, tag_id;
- const git_signature *tagger;
+ git_signature *tagger;
git_object *target;
must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
0));
git_object_close(target);
- git_signature_free((git_signature *)tagger);
+ git_signature_free(tagger);
git_repository_free(repo);
BEGIN_TEST(write3, "Replace an already existing tag")
git_repository *repo;
git_oid target_id, tag_id, old_tag_id;
- const git_signature *tagger;
+ git_signature *tagger;
git_reference *ref_tag;
git_object *target;
1));
git_object_close(target);
- git_signature_free((git_signature *)tagger);
+ git_signature_free(tagger);
must_pass(git_reference_lookup(&ref_tag, repo, "refs/tags/e90810b"));
must_be_true(git_oid_cmp(git_reference_oid(ref_tag), &tag_id) == 0);