Skip to content

Commit 72f627d

Browse files
andyparkinsJunio C Hamano
authored andcommitted
Fix potential command line overflow in hooks--update
In a repository with a large number of refs, the following command line could easily overflow the command line size limitations git-rev-list $newref $(git-rev-parse --not --all) Fortunately, git-rev-list already has the means to cope with this situation with the --stdin switch git-rev-parse --not --all | git-rev-list --stdin $newref Which is exactly what this patch does. Signed-off-by: Andy Parkins <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c2120e5 commit 72f627d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/hooks--update

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ case "$refname_type" in
148148
# This shows all log entries that are not already covered by
149149
# another ref - i.e. commits that are now accessible from this
150150
# ref that were previously not accessible
151-
git-rev-list --pretty $newref $(git-rev-parse --not --all)
151+
git-rev-parse --not --all | git-rev-list --stdin --pretty $newref
152152
echo $LOGEND
153153
else
154154
# oldrev is valid

0 commit comments

Comments
 (0)