Skip to content

Commit 1e63341

Browse files
committed
Merge branch 'maint'
* maint: Fix typo in pack-objects' usage Make sure that git_getpass() never returns NULL t0004 (unwritable files): simplify error handling rev-list-options: clarify --parents and --children
2 parents 9855b08 + 8695353 commit 1e63341

File tree

4 files changed

+25
-45
lines changed

4 files changed

+25
-45
lines changed

Documentation/rev-list-options.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ endif::git-rev-list[]
4545

4646
--parents::
4747

48-
Print the parents of the commit. Also enables parent
49-
rewriting, see 'History Simplification' below.
48+
Print also the parents of the commit (in the form "commit parent...").
49+
Also enables parent rewriting, see 'History Simplification' below.
5050

5151
--children::
5252

53-
Print the children of the commit. Also enables parent
54-
rewriting, see 'History Simplification' below.
53+
Print also the children of the commit (in the form "commit child...").
54+
Also enables parent rewriting, see 'History Simplification' below.
5555

5656
ifdef::git-rev-list[]
5757
--timestamp::

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static const char pack_usage[] =
3030
" [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n"
3131
" [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n"
3232
" [--reflog] [--stdout | base-name] [--include-tag]\n"
33-
" [--keep-unreachable | --unpack-unreachable \n"
33+
" [--keep-unreachable | --unpack-unreachable]\n"
3434
" [<ref-list | <object-list]";
3535

3636
struct object_entry {

connect.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,12 @@ char *git_getpass(const char *prompt)
631631
askpass = askpass_program;
632632
if (!askpass)
633633
askpass = getenv("SSH_ASKPASS");
634-
if (!askpass || !(*askpass))
635-
return getpass(prompt);
634+
if (!askpass || !(*askpass)) {
635+
char *result = getpass(prompt);
636+
if (!result)
637+
die_errno("Could not read password");
638+
return result;
639+
}
636640

637641
args[0] = askpass;
638642
args[1] = prompt;

t/t0004-unwritable.sh

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,29 @@ test_expect_success setup '
1616
'
1717

1818
test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' '
19-
20-
(
21-
chmod a-w .git/objects .git/objects/?? &&
22-
test_must_fail git write-tree
23-
)
24-
status=$?
25-
chmod 775 .git/objects .git/objects/??
26-
(exit $status)
27-
19+
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
20+
chmod a-w .git/objects .git/objects/?? &&
21+
test_must_fail git write-tree
2822
'
2923

3024
test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
31-
32-
(
33-
chmod a-w .git/objects .git/objects/?? &&
34-
test_must_fail git commit -m second
35-
)
36-
status=$?
37-
chmod 775 .git/objects .git/objects/??
38-
(exit $status)
39-
25+
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
26+
chmod a-w .git/objects .git/objects/?? &&
27+
test_must_fail git commit -m second
4028
'
4129

4230
test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' '
43-
44-
(
45-
echo 6O >file &&
46-
chmod a-w .git/objects .git/objects/?? &&
47-
test_must_fail git update-index file
48-
)
49-
status=$?
50-
chmod 775 .git/objects .git/objects/??
51-
(exit $status)
52-
31+
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
32+
echo 6O >file &&
33+
chmod a-w .git/objects .git/objects/?? &&
34+
test_must_fail git update-index file
5335
'
5436

5537
test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' '
56-
57-
(
58-
echo b >file &&
59-
chmod a-w .git/objects .git/objects/?? &&
60-
test_must_fail git add file
61-
)
62-
status=$?
63-
chmod 775 .git/objects .git/objects/??
64-
(exit $status)
65-
38+
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
39+
echo b >file &&
40+
chmod a-w .git/objects .git/objects/?? &&
41+
test_must_fail git add file
6642
'
6743

6844
test_done

0 commit comments

Comments
 (0)