transport: not report a non-head push as a branch
When pushing a new reference (not a head or tag), report it as a new reference instead of a new branch. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b34789c0b0
commit
917c612512
@ -1039,7 +1039,7 @@ test_force_fetch_tag "annotated tag" "-f -a -m'tag message'"
|
|||||||
test_expect_success 'push --porcelain' '
|
test_expect_success 'push --porcelain' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
echo >.git/foo "To testrepo" &&
|
echo >.git/foo "To testrepo" &&
|
||||||
echo >>.git/foo "* refs/heads/master:refs/remotes/origin/master [new branch]" &&
|
echo >>.git/foo "* refs/heads/master:refs/remotes/origin/master [new reference]" &&
|
||||||
echo >>.git/foo "Done" &&
|
echo >>.git/foo "Done" &&
|
||||||
git push >.git/bar --porcelain testrepo refs/heads/master:refs/remotes/origin/master &&
|
git push >.git/bar --porcelain testrepo refs/heads/master:refs/remotes/origin/master &&
|
||||||
(
|
(
|
||||||
|
@ -500,9 +500,12 @@ static void print_ok_ref_status(struct ref *ref, int porcelain, int summary_widt
|
|||||||
porcelain, summary_width);
|
porcelain, summary_width);
|
||||||
else if (is_null_oid(&ref->old_oid))
|
else if (is_null_oid(&ref->old_oid))
|
||||||
print_ref_status('*',
|
print_ref_status('*',
|
||||||
(starts_with(ref->name, "refs/tags/") ? "[new tag]" :
|
(starts_with(ref->name, "refs/tags/")
|
||||||
"[new branch]"),
|
? "[new tag]"
|
||||||
ref, ref->peer_ref, NULL, porcelain, summary_width);
|
: (starts_with(ref->name, "refs/heads/")
|
||||||
|
? "[new branch]"
|
||||||
|
: "[new reference]")),
|
||||||
|
ref, ref->peer_ref, NULL, porcelain, summary_width);
|
||||||
else {
|
else {
|
||||||
struct strbuf quickref = STRBUF_INIT;
|
struct strbuf quickref = STRBUF_INIT;
|
||||||
char type;
|
char type;
|
||||||
|
Loading…
Reference in New Issue
Block a user