Skip to content

Commit 6b971f6

Browse files
Denton-Lgitster
authored andcommitted
t5516: introduce 'push ref expression with non-existent oid src'
It is possible to trigger a Git bug by pushing a refspec where the source is an oid that's non-existent. An example of the error message produced is as follows: error: The destination you provided is not a full refname (i.e., starting with "refs/"). We tried to guess what you meant by: - Looking for a ref that matches 'branch' on the remote side. - Checking if the <src> being pushed ('0000000000000000000000000000000000000001') is a ref in "refs/{heads,tags}/". If so we add a corresponding refs/{heads,tags}/ prefix on the remote side. Neither worked, so we gave up. You must fully qualify the ref. BUG: remote.c:1221: '0000000000000000000000000000000000000001' should be commit/tag/tree/blob, is '-1' fatal: the remote end hung up unexpectedly Aborted (core dumped) Document this failure in a test case so that it can be confirmed fixed later. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16bd9f2 commit 6b971f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/t5516-fetch-push.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,13 @@ test_expect_success 'push ref expression with non-existent, incomplete dest' '
509509
510510
'
511511

512+
test_expect_failure 'push ref expression with non-existent oid src' '
513+
514+
mk_test testrepo &&
515+
test_must_fail git push testrepo $(test_oid 001):branch
516+
517+
'
518+
512519
for head in HEAD @
513520
do
514521

0 commit comments

Comments
 (0)