Commit Graph

7 Commits

Author SHA1 Message Date
Jeff King
09fba7a59d t5516: test update of local refs on push
The first test (updating local refs) should succeed without the
prior commit, but the second one (not updating on error) used to
fail before the prior commit was written.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-18 03:46:00 -04:00
Brian Ewins
11f2441f05 Add a --dry-run option to git-push.
The default behaviour of git-push is potentially confusing
for new users, since it will push changes that are not on
the current branch. Publishing patches that were still
cooking on a development branch is hard to undo.

It would also be nice to be able to verify the expansion
of refspecs if you've edited them, so that you know
what branches matched on the server.

Adding a --dry-run flag allows the user to experiment
safely and learn how to use git-push properly. Originally
suggested by Steffen Prohaska.

Signed-off-by: Brian Ewins <brian.ewins@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 22:02:52 -04:00
Alex Riesen
586e4ce248 Fix t5516 to create test repo without hooks
Otherwise the hooks will be executed on cygwin and the test will fail
because of the contributed hooks.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-04 12:41:42 -07:00
Brian Gernhardt
9a3c6f7ba7 Fix t5516-fetch for systems where wc -l outputs whitespace.
When wc outputs whitespace, the test "$(command | wc -l)" = 1 is
broken because "   1" != "1".  Let the shell eat the whitespace by
using test 1 = $(command | wc -l) instead.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-01 14:47:20 -07:00
Junio C Hamano
1ed10b886b remote.c: "git-push frotz" should update what matches at the source.
Earlier, when the local repository has a branch "frotz" and the
remote repository has a tag "frotz" (but not branch "frotz"),
"git-push frotz" mistakenly updated the tag at the remote side.
This was because the partial refname matching code was applied
independently on both source and destination side.

With this fix, when a colon-less refspec is given to git-push,
we first match it with the refs in the source repository, and
update the matching ref in the destination repository.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-09 11:53:01 -07:00
Junio C Hamano
6125796f7d remote.c: fix "git push" weak match disambiguation
When "git push A:B" is given, and A (or B) is not a full refname
that begins with refs/, we require an unambiguous match with an
existing ref.  For this purpose, a match with a local branch or
a tag (i.e. refs/heads/A and refs/tags/A) is called a "strong
match", and any other match is called a "weak match".  A partial
refname is unambiguous when there is only one strong match with
any number of weak matches, or when there is only one weak match
and no other match.

However, as reported by Sparse with Ramsay Jones recently,
count_refspec_match() function had a bug where a variable in an
inner block masked a different variable of the same name, which
caused the weak matches to be ignored.

This fixes it, and adds tests for the fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-09 11:53:01 -07:00
Junio C Hamano
bcdb34f70d Test wildcard push/fetch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-08 00:43:22 -07:00