Skip to content

Commit ab5dbce

Browse files
committed
fix: 🐛 Avoid useless clean when a file is reverted
1 parent f6d3f34 commit ab5dbce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.hooks/post-checkout

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ checkoutType=$3
1111
[[ $checkoutType == 1 ]] && checkoutType='branch' ||
1212
checkoutType='file' ;
1313

14-
echo 'Checkout type: '$checkoutType
14+
echo 'Checkout type: '$checkoutType
15+
1516
echo ' prev HEAD: '`git name-rev --name-only $prevHEAD`
1617
echo ' new HEAD: '`git name-rev --name-only $newHEAD`
1718

19+
# this is a file checkout – do nothing
20+
if [ $checkoutType == 'file' ]; then exit; fi
21+
1822
make clean

0 commit comments

Comments
 (0)