@matheusbsbs / matheus-bagliano / commits / 5241bfe6d1
Fork 0

http-push: fix revision walk

The revision walk was not including tags because setup_revisions zeroes out the revs flags. Pass --objects so it picks up all the necessary bits. Signed-off-by: Junio C Hamano <junkio@cox.net>

Nick Hengeveld committed Mar 10, 2006 at 20:17 UTC 5241bfe6d1593ad775dd79a5f598f66f479968b5
1 file changed +5 -8
http-push.c
+5 -8
@@ -1752,23 +1752,20 @@ int main(int argc, char **argv)
1752 }
1753
1754 /* Set up revision info for this refspec */
1755 - const char *commit_argv[3];
1756 - int commit_argc = 2;
1755 + const char *commit_argv[4];
1756 + int commit_argc = 3;
1757 char *new_sha1_hex = strdup(sha1_to_hex(ref->new_sha1));
1758 char *old_sha1_hex = NULL;
1759 - commit_argv[1] = new_sha1_hex;
1759 + commit_argv[1] = "--objects";
1760 + commit_argv[2] = new_sha1_hex;
1761 if (!push_all && !is_zero_sha1(ref->old_sha1)) {
1762 old_sha1_hex = xmalloc(42);
1763 sprintf(old_sha1_hex, "^%s",
1764 sha1_to_hex(ref->old_sha1));
1764 - commit_argv[2] = old_sha1_hex;
1765 + commit_argv[3] = old_sha1_hex;
1766 commit_argc++;
1767 }
1767 - revs.commits = NULL;
1768 setup_revisions(commit_argc, commit_argv, &revs, NULL);
1769 - revs.tag_objects = 1;
1770 - revs.tree_objects = 1;
1771 - revs.blob_objects = 1;
1769 free(new_sha1_hex);
1770 if (old_sha1_hex) {
1771 free(old_sha1_hex);