File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- file=" $1 "
2+
3+ file=" "
4+ range=" "
5+ for i in " $@ "
6+ do
7+ # use '--' to seperate file list and rev-list arguments
8+ test " $i " == ' --' && shift && break
9+ file=" $file " ' ' " $i "
10+ shift
11+ done
12+ test -n " $* " && range=" $* "
13+
314test -z " $file " && echo " file required." 1>&2 && exit 1
4- git filter-branch -f --index-filter " git rm -r --cached '$file ' --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all
15+ if [ -z " $range " ]
16+ then
17+ git filter-branch -f --index-filter " git rm -r --cached " " $file " " --ignore-unmatch" \
18+ --prune-empty --tag-name-filter cat -- --all
19+ else
20+ # don't quote $range so that we can forward multiple rev-list arguments
21+ git filter-branch -f --index-filter " git rm -r --cached " " $file " " --ignore-unmatch" \
22+ --prune-empty --tag-name-filter cat -- $range
23+ fi
You can’t perform that action at this time.
0 commit comments