Skip to content

Commit 2e560d5

Browse files
authored
Merge pull request #17 from unixorn/fix-git-purge-from-history
Fix arg handling error in git-purge-from-history
2 parents ada54a8 + 61a054c commit 2e560d5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/git-purge-from-history

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ set -o errexit
99
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
1010
#
1111

12-
if [ $# -eq 0 ]; then
13-
exit 0are still
12+
if [[ $# -eq 0 ]]; then
13+
echo "You must specify a file/directory to purge from your git history"
14+
exit 1
1415
fi
1516

1617
# make sure we're at the root of git repo
17-
if [ ! -d .git ]; then
18-
echo "Error: must run this script from the root of a git repository"
19-
exit 1
18+
if [[ ! -d .git ]]; then
19+
echo "Error: must run this script from the root of a git repository"
20+
exit 1
2021
fi
2122

2223
# remove all paths passed as arguments from the history of the repo

0 commit comments

Comments
 (0)