Skip to content

Commit

Permalink
git-filter-branch: avoid collisions with variables in eval'ed commands
Browse files Browse the repository at this point in the history
Avoid using simple variable names like 'i', since user commands are eval'ed
and may clash with and overwrite our values.

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Elijah Newren authored and Junio C Hamano committed Mar 25, 2009
1 parent 8befac5 commit d5b0c97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-filter-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ test $commits -eq 0 && die "Found nothing to rewrite"

# Rewrite the commits

i=0
git_filter_branch__commit_count=0
while read commit parents; do
i=$(($i+1))
printf "\rRewrite $commit ($i/$commits)"
git_filter_branch__commit_count=$(($git_filter_branch__commit_count+1))
printf "\rRewrite $commit ($git_filter_branch__commit_count/$commits)"

case "$filter_subdir" in
"")
Expand Down

0 comments on commit d5b0c97

Please sign in to comment.