summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-09-30 14:59:53 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-09-30 14:59:53 -0700
commit1e633418479926bc85ed21a4f91c845a3dd3ad66 (patch)
treeabcd420c9b200b22e4c62065b2b4db089c091a50
parentStart 1.7.4 cycle (diff)
parentFix typo in pack-objects' usage (diff)
downloadtgif-1e633418479926bc85ed21a4f91c845a3dd3ad66.tar.xz
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
-rw-r--r--Documentation/rev-list-options.txt8
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--connect.c8
-rwxr-xr-xt/t0004-unwritable.sh52
4 files changed, 25 insertions, 45 deletions
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index e2237ae4a0..ebc0108731 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -45,13 +45,13 @@ endif::git-rev-list[]
--parents::
- Print the parents of the commit. Also enables parent
- rewriting, see 'History Simplification' below.
+ Print also the parents of the commit (in the form "commit parent...").
+ Also enables parent rewriting, see 'History Simplification' below.
--children::
- Print the children of the commit. Also enables parent
- rewriting, see 'History Simplification' below.
+ Print also the children of the commit (in the form "commit child...").
+ Also enables parent rewriting, see 'History Simplification' below.
ifdef::git-rev-list[]
--timestamp::
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0e81673118..3756cf36ee 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -30,7 +30,7 @@ static const char pack_usage[] =
" [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n"
" [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n"
" [--reflog] [--stdout | base-name] [--include-tag]\n"
- " [--keep-unreachable | --unpack-unreachable \n"
+ " [--keep-unreachable | --unpack-unreachable]\n"
" [<ref-list | <object-list]";
struct object_entry {
diff --git a/connect.c b/connect.c
index 3450cabd0e..57dc20c43c 100644
--- a/connect.c
+++ b/connect.c
@@ -631,8 +631,12 @@ char *git_getpass(const char *prompt)
askpass = askpass_program;
if (!askpass)
askpass = getenv("SSH_ASKPASS");
- if (!askpass || !(*askpass))
- return getpass(prompt);
+ if (!askpass || !(*askpass)) {
+ char *result = getpass(prompt);
+ if (!result)
+ die_errno("Could not read password");
+ return result;
+ }
args[0] = askpass;
args[1] = prompt;
diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh
index 385b1265de..e3137d638e 100755
--- a/t/t0004-unwritable.sh
+++ b/t/t0004-unwritable.sh
@@ -16,53 +16,29 @@ test_expect_success setup '
'
test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' '
-
- (
- chmod a-w .git/objects .git/objects/?? &&
- test_must_fail git write-tree
- )
- status=$?
- chmod 775 .git/objects .git/objects/??
- (exit $status)
-
+ test_when_finished "chmod 775 .git/objects .git/objects/??" &&
+ chmod a-w .git/objects .git/objects/?? &&
+ test_must_fail git write-tree
'
test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
-
- (
- chmod a-w .git/objects .git/objects/?? &&
- test_must_fail git commit -m second
- )
- status=$?
- chmod 775 .git/objects .git/objects/??
- (exit $status)
-
+ test_when_finished "chmod 775 .git/objects .git/objects/??" &&
+ chmod a-w .git/objects .git/objects/?? &&
+ test_must_fail git commit -m second
'
test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' '
-
- (
- echo 6O >file &&
- chmod a-w .git/objects .git/objects/?? &&
- test_must_fail git update-index file
- )
- status=$?
- chmod 775 .git/objects .git/objects/??
- (exit $status)
-
+ test_when_finished "chmod 775 .git/objects .git/objects/??" &&
+ echo 6O >file &&
+ chmod a-w .git/objects .git/objects/?? &&
+ test_must_fail git update-index file
'
test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' '
-
- (
- echo b >file &&
- chmod a-w .git/objects .git/objects/?? &&
- test_must_fail git add file
- )
- status=$?
- chmod 775 .git/objects .git/objects/??
- (exit $status)
-
+ test_when_finished "chmod 775 .git/objects .git/objects/??" &&
+ echo b >file &&
+ chmod a-w .git/objects .git/objects/?? &&
+ test_must_fail git add file
'
test_done