summaryrefslogtreecommitdiff
path: root/t/t6017-rev-list-stdin.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-11 21:01:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-11 21:43:56 (GMT)
commit4da5af3151301d25a25d60a90b8275eaca13de86 (patch)
treea7973fe80bb83266276853456cc84b0a08667578 /t/t6017-rev-list-stdin.sh
parent902f235378cb2b2f6dd5dd664b9630c95321f0ae (diff)
downloadgit-4da5af3151301d25a25d60a90b8275eaca13de86.zip
git-4da5af3151301d25a25d60a90b8275eaca13de86.tar.gz
git-4da5af3151301d25a25d60a90b8275eaca13de86.tar.bz2
setup_revisions(): take pathspec from command line and --stdin correctly
When the command line has "--" disambiguator, we take the remainder of argv[] as "prune_data", but when --stdin is given at the same time, we need to append to the existing prune_data and end up attempting to realloc(3) it. That would not work. Fix it by consistently using append_prune_data() throughout the input processing. Also avoid counting the number of existing paths in the function over and over again. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6017-rev-list-stdin.sh')
-rwxr-xr-xt/t6017-rev-list-stdin.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t6017-rev-list-stdin.sh b/t/t6017-rev-list-stdin.sh
index f1c32db..667b375 100755
--- a/t/t6017-rev-list-stdin.sh
+++ b/t/t6017-rev-list-stdin.sh
@@ -58,4 +58,21 @@ check side-3 ^side-4 -- file-3
check side-3 ^side-2
check side-3 ^side-2 -- file-1
+test_expect_success 'not only --stdin' '
+ cat >expect <<-EOF &&
+ 7
+
+ file-1
+ file-2
+ EOF
+ cat >input <<-EOF &&
+ ^master^
+ --
+ file-2
+ EOF
+ git log --pretty=tformat:%s --name-only --stdin master -- file-1 \
+ <input >actual &&
+ test_cmp expect actual
+'
+
test_done