summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2009-03-25 21:51:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-25 23:35:52 (GMT)
commitd5b0c97d138201c59b30cb759cedabb70b7bae81 (patch)
tree9bfaff822c4290edbec807341e04e0253a4c9b7d /git-filter-branch.sh
parent8befac5d6f9e994d72efb1ecc59c356414114e7e (diff)
downloadgit-d5b0c97d138201c59b30cb759cedabb70b7bae81.zip
git-d5b0c97d138201c59b30cb759cedabb70b7bae81.tar.gz
git-d5b0c97d138201c59b30cb759cedabb70b7bae81.tar.bz2
git-filter-branch: avoid collisions with variables in eval'ed commands
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>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 20f6f51..b90d3df 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -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
"")