зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
1e63341847
|
@ -45,13 +45,13 @@ endif::git-rev-list[]
|
||||||
|
|
||||||
--parents::
|
--parents::
|
||||||
|
|
||||||
Print the parents of the commit. Also enables parent
|
Print also the parents of the commit (in the form "commit parent...").
|
||||||
rewriting, see 'History Simplification' below.
|
Also enables parent rewriting, see 'History Simplification' below.
|
||||||
|
|
||||||
--children::
|
--children::
|
||||||
|
|
||||||
Print the children of the commit. Also enables parent
|
Print also the children of the commit (in the form "commit child...").
|
||||||
rewriting, see 'History Simplification' below.
|
Also enables parent rewriting, see 'History Simplification' below.
|
||||||
|
|
||||||
ifdef::git-rev-list[]
|
ifdef::git-rev-list[]
|
||||||
--timestamp::
|
--timestamp::
|
||||||
|
|
|
@ -30,7 +30,7 @@ static const char pack_usage[] =
|
||||||
" [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n"
|
" [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n"
|
||||||
" [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n"
|
" [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n"
|
||||||
" [--reflog] [--stdout | base-name] [--include-tag]\n"
|
" [--reflog] [--stdout | base-name] [--include-tag]\n"
|
||||||
" [--keep-unreachable | --unpack-unreachable \n"
|
" [--keep-unreachable | --unpack-unreachable]\n"
|
||||||
" [<ref-list | <object-list]";
|
" [<ref-list | <object-list]";
|
||||||
|
|
||||||
struct object_entry {
|
struct object_entry {
|
||||||
|
|
|
@ -631,8 +631,12 @@ char *git_getpass(const char *prompt)
|
||||||
askpass = askpass_program;
|
askpass = askpass_program;
|
||||||
if (!askpass)
|
if (!askpass)
|
||||||
askpass = getenv("SSH_ASKPASS");
|
askpass = getenv("SSH_ASKPASS");
|
||||||
if (!askpass || !(*askpass))
|
if (!askpass || !(*askpass)) {
|
||||||
return getpass(prompt);
|
char *result = getpass(prompt);
|
||||||
|
if (!result)
|
||||||
|
die_errno("Could not read password");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = askpass;
|
args[0] = askpass;
|
||||||
args[1] = prompt;
|
args[1] = prompt;
|
||||||
|
|
|
@ -16,53 +16,29 @@ test_expect_success setup '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' '
|
test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' '
|
||||||
|
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
||||||
(
|
chmod a-w .git/objects .git/objects/?? &&
|
||||||
chmod a-w .git/objects .git/objects/?? &&
|
test_must_fail git write-tree
|
||||||
test_must_fail git write-tree
|
|
||||||
)
|
|
||||||
status=$?
|
|
||||||
chmod 775 .git/objects .git/objects/??
|
|
||||||
(exit $status)
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
|
test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
|
||||||
|
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
||||||
(
|
chmod a-w .git/objects .git/objects/?? &&
|
||||||
chmod a-w .git/objects .git/objects/?? &&
|
test_must_fail git commit -m second
|
||||||
test_must_fail git commit -m second
|
|
||||||
)
|
|
||||||
status=$?
|
|
||||||
chmod 775 .git/objects .git/objects/??
|
|
||||||
(exit $status)
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' '
|
test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' '
|
||||||
|
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
||||||
(
|
echo 6O >file &&
|
||||||
echo 6O >file &&
|
chmod a-w .git/objects .git/objects/?? &&
|
||||||
chmod a-w .git/objects .git/objects/?? &&
|
test_must_fail git update-index file
|
||||||
test_must_fail git update-index file
|
|
||||||
)
|
|
||||||
status=$?
|
|
||||||
chmod 775 .git/objects .git/objects/??
|
|
||||||
(exit $status)
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' '
|
test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' '
|
||||||
|
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
||||||
(
|
echo b >file &&
|
||||||
echo b >file &&
|
chmod a-w .git/objects .git/objects/?? &&
|
||||||
chmod a-w .git/objects .git/objects/?? &&
|
test_must_fail git add file
|
||||||
test_must_fail git add file
|
|
||||||
)
|
|
||||||
status=$?
|
|
||||||
chmod 775 .git/objects .git/objects/??
|
|
||||||
(exit $status)
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Загрузка…
Ссылка в новой задаче