Skip to content

Commit 105a633

Browse files
committed
Merge branch 'maint'
* maint: blame: prevent a segv when -L given start > EOF git-push: document all the status flags used in the output Fix parsing of imap.preformattedHTML and imap.sslverify git-add documentation: Fix shell quoting example
2 parents 720c9f7 + e33cc59 commit 105a633

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

Documentation/git-add.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ EXAMPLES
153153
and its subdirectories:
154154
+
155155
------------
156-
$ git add Documentation/\\*.txt
156+
$ git add Documentation/\*.txt
157157
------------
158158
+
159159
Note that the asterisk `\*` is quoted from the shell in this

Documentation/git-push.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,17 @@ If --porcelain is used, then each line of the output is of the form:
176176
<flag> \t <from>:<to> \t <summary> (<reason>)
177177
-------------------------------
178178

179+
The status of up-to-date refs is shown only if --porcelain or --verbose
180+
option is used.
181+
179182
flag::
180-
A single character indicating the status of the ref. This is
181-
blank for a successfully pushed ref, `!` for a ref that was
182-
rejected or failed to push, and '=' for a ref that was up to
183-
date and did not need pushing (note that the status of up to
184-
date refs is shown only when `git push` is running verbosely).
183+
A single character indicating the status of the ref:
184+
(space);; for a successfully pushed fast-forward;
185+
`{plus}`;; for a successful forced update;
186+
`-`;; for a successfully deleted ref;
187+
`*`;; for a successfully pushed new ref;
188+
`!`;; for a ref that was rejected or failed to push; and
189+
`=`;; for a ref that was up to date and did not need pushing.
185190

186191
summary::
187192
For a successfully pushed ref, the summary shows the old and new

builtin-blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
24332433
if (top < 1)
24342434
top = lno;
24352435
bottom--;
2436-
if (lno < top)
2436+
if (lno < top || lno < bottom)
24372437
die("file %s has only %lu lines", path, lno);
24382438

24392439
ent = xcalloc(1, sizeof(*ent));

imap-send.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,11 +1331,16 @@ static int git_imap_config(const char *key, const char *val, void *cb)
13311331
if (strncmp(key, imap_key, sizeof imap_key - 1))
13321332
return 0;
13331333

1334-
if (!val)
1335-
return config_error_nonbool(key);
1336-
13371334
key += sizeof imap_key - 1;
13381335

1336+
/* check booleans first, and barf on others */
1337+
if (!strcmp("sslverify", key))
1338+
server.ssl_verify = git_config_bool(key, val);
1339+
else if (!strcmp("preformattedhtml", key))
1340+
server.use_html = git_config_bool(key, val);
1341+
else if (!val)
1342+
return config_error_nonbool(key);
1343+
13391344
if (!strcmp("folder", key)) {
13401345
imap_folder = xstrdup(val);
13411346
} else if (!strcmp("host", key)) {
@@ -1356,10 +1361,6 @@ static int git_imap_config(const char *key, const char *val, void *cb)
13561361
server.port = git_config_int(key, val);
13571362
else if (!strcmp("tunnel", key))
13581363
server.tunnel = xstrdup(val);
1359-
else if (!strcmp("sslverify", key))
1360-
server.ssl_verify = git_config_bool(key, val);
1361-
else if (!strcmp("preformattedHTML", key))
1362-
server.use_html = git_config_bool(key, val);
13631364
return 0;
13641365
}
13651366

t/t8003-blame.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,12 @@ EOF
157157
git --no-pager blame $COMMIT -- uno >/dev/null
158158
'
159159

160+
test_expect_success 'blame -L with invalid start' '
161+
test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines"
162+
'
163+
164+
test_expect_success 'blame -L with invalid end' '
165+
git blame -L1,5 tres 2>&1 | grep "has only 2 lines"
166+
'
167+
160168
test_done

0 commit comments

Comments
 (0)