Skip to content

Commit 9f8c611

Browse files
committed
Added a bit of sanity checking to git-flush.
1 parent 3189444 commit 9f8c611

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-flush

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
# be bloating your pack files.
66

77
rm -fr .git/refs/original
8-
perl -i -ne 'print unless /refs\/original/;' .git/info/refs .git/packed-refs
8+
if [ -f .git/info/refs ]; then
9+
perl -i -ne 'print unless /refs\/original/;' .git/info/refs
10+
fi
11+
if [ -f .git/packed-refs ]; then
12+
perl -i -ne 'print unless /refs\/original/;' .git/packed-refs
13+
fi
914

1015
git reflog expire --expire=0 --all
1116

0 commit comments

Comments
 (0)