Skip to content

Commit

Permalink
Fix potential command line overflow in hooks--update
Browse files Browse the repository at this point in the history
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 <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Andy Parkins authored and Junio C Hamano committed Feb 13, 2007
1 parent c2120e5 commit 72f627d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/hooks--update
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ case "$refname_type" in
# This shows all log entries that are not already covered by
# another ref - i.e. commits that are now accessible from this
# ref that were previously not accessible
git-rev-list --pretty $newref $(git-rev-parse --not --all)
git-rev-parse --not --all | git-rev-list --stdin --pretty $newref
echo $LOGEND
else
# oldrev is valid
Expand Down

0 comments on commit 72f627d

Please sign in to comment.