Skip to content

Commit 5241bfe

Browse files
Nick HengeveldJunio C Hamano
authored andcommitted
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 <[email protected]>
1 parent f2561fd commit 5241bfe

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

http-push.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,23 +1752,20 @@ int main(int argc, char **argv)
17521752
}
17531753

17541754
/* 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;
17571757
char *new_sha1_hex = strdup(sha1_to_hex(ref->new_sha1));
17581758
char *old_sha1_hex = NULL;
1759-
commit_argv[1] = new_sha1_hex;
1759+
commit_argv[1] = "--objects";
1760+
commit_argv[2] = new_sha1_hex;
17601761
if (!push_all && !is_zero_sha1(ref->old_sha1)) {
17611762
old_sha1_hex = xmalloc(42);
17621763
sprintf(old_sha1_hex, "^%s",
17631764
sha1_to_hex(ref->old_sha1));
1764-
commit_argv[2] = old_sha1_hex;
1765+
commit_argv[3] = old_sha1_hex;
17651766
commit_argc++;
17661767
}
1767-
revs.commits = NULL;
17681768
setup_revisions(commit_argc, commit_argv, &revs, NULL);
1769-
revs.tag_objects = 1;
1770-
revs.tree_objects = 1;
1771-
revs.blob_objects = 1;
17721769
free(new_sha1_hex);
17731770
if (old_sha1_hex) {
17741771
free(old_sha1_hex);

0 commit comments

Comments
 (0)