Skip to content

Commit 752b0fe

Browse files
author
Junio C Hamano
committed
Merge branch 'fix'
* fix: git-push: Update documentation to describe the no-refspec behavior. format-patch: pretty-print timestamp correctly. git-add: Add support for --, documentation, and test.
2 parents 6b98579 + aa06474 commit 752b0fe

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

Documentation/git-add.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ git-add - Add files to the index file.
77

88
SYNOPSIS
99
--------
10-
'git-add' [-n] [-v] <file>...
10+
'git-add' [-n] [-v] [--] <file>...
1111

1212
DESCRIPTION
1313
-----------
@@ -26,6 +26,11 @@ OPTIONS
2626
-v::
2727
Be verbose.
2828

29+
--::
30+
This option can be used to separate command-line options from
31+
the list of files, (useful when filenames might be mistaken
32+
for command-line options).
33+
2934

3035
DISCUSSION
3136
----------

Documentation/git-push.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ to fast forward the remote ref that matches <dst>. If
4343
the optional plus `+` is used, the remote ref is updated
4444
even if it does not result in a fast forward update.
4545
+
46+
Note: If no explicit refspec is found, (that is neither
47+
on the command line nor in any Push line of the
48+
corresponding remotes file---see below), then all the
49+
refs that exist both on the local side and on the remote
50+
side are updated.
51+
+
4652
Some short-cut notations are also supported.
4753
+
4854
* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.

git-add.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ while : ; do
1414
-v)
1515
verbose=--verbose
1616
;;
17+
--)
18+
shift
19+
break
20+
;;
1721
-*)
1822
usage
1923
;;

git-format-patch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ my @month_names = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
189189
sub show_date {
190190
my ($time, $tz) = @_;
191191
my $minutes = abs($tz);
192-
$minutes = ($minutes / 100) * 60 + ($minutes % 100);
192+
$minutes = int($minutes / 100) * 60 + ($minutes % 100);
193193
if ($tz < 0) {
194194
$minutes = -$minutes;
195195
}

t/t3700-add.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2006 Carl D. Worth
4+
#
5+
6+
test_description='Test of git-add, including the -- option.'
7+
8+
. ./test-lib.sh
9+
10+
test_expect_success \
11+
'Test of git-add' \
12+
'touch foo && git-add foo'
13+
14+
test_expect_success \
15+
'Post-check that foo is in the index' \
16+
'git-ls-files foo | grep foo'
17+
18+
test_expect_success \
19+
'Test that "git-add -- -q" works' \
20+
'touch -- -q && git-add -- -q'
21+
22+
test_done

0 commit comments

Comments
 (0)