@matheusbsbs / matheus-bagliano / commits / 5c633a4cbe
Fork 0

git-push: documentation and tests for pushing only branches

Commit 098e711e caused git-push to match only branches when considering which refs to push. This patch updates the documentation accordingly and adds a test for this behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Sep 18, 2007 at 04:15 UTC 5c633a4cbeb95fc86c9b3e6126749cf34a2691b5
3 files changed +14 -4
Documentation/git-push.txt
+2 -2
@@ -48,7 +48,7 @@ even if it does not result in a fast forward update.
48 Note: If no explicit refspec is found, (that is neither
49 on the command line nor in any Push line of the
50 corresponding remotes file---see below), then all the
51 -refs that exist both on the local side and on the remote
51 +heads that exist both on the local side and on the remote
52 side are updated.
53 +
54 `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
@@ -61,7 +61,7 @@ the remote repository.
61
62 \--all::
63 Instead of naming each ref to push, specifies that all
64 - refs be pushed.
64 + refs under `$GIT_DIR/refs/heads/` be pushed.
65
66 \--tags::
67 All refs under `$GIT_DIR/refs/tags` are pushed, in
Documentation/git-send-pack.txt
+2 -2
@@ -32,7 +32,7 @@ OPTIONS
32
33 \--all::
34 Instead of explicitly specifying which refs to update,
35 - update all refs that locally exist.
35 + update all heads that locally exist.
36
37 \--force::
38 Usually, the command refuses to update a remote ref that
@@ -70,7 +70,7 @@ With '--all' flag, all refs that exist locally are transferred to
70 the remote side. You cannot specify any '<ref>' if you use
71 this flag.
72
73 -Without '--all' and without any '<ref>', the refs that exist
73 +Without '--all' and without any '<ref>', the heads that exist
74 both on the local side and on the remote side are updated.
75
76 When one or more '<ref>' are specified explicitly, it can be either a
t/t5400-send-pack.sh
+10
@@ -113,4 +113,14 @@ test_expect_success \
113 ! git diff .git/refs/heads/master victim/.git/refs/heads/master
114 '
115
116 +test_expect_success \
117 + 'pushing does not include non-head refs' '
118 + mkdir parent && cd parent &&
119 + git-init && touch file && git-add file && git-commit -m add &&
120 + cd .. &&
121 + git-clone parent child && cd child && git-push --all &&
122 + cd ../parent &&
123 + git-branch -a >branches && ! grep -q origin/master branches
124 +'
125 +
126 test_done