Skip to content

Commit cc564f9

Browse files
committed
verify-subtree.sh: relax check and ignore old content
If for whatever reasons a repo already had a `release-tools` directory before doing a clean import of it with `git subtree`, the check used to fail because it found those old commits. This can be fixed by telling `git log` to stop when the directory disappears from the repo. There has to be a commit with removes the old content, because otherwise `git subtree add` doesn't work. Fixes: kubernetes-csi/external-resizer#21
1 parent 33d58fd commit cc564f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

verify-subtree.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [ ! "$DIR" ]; then
3030
exit 1
3131
fi
3232

33-
REV=$(git log -n1 --format=format:%H --no-merges -- "$DIR")
33+
REV=$(git log -n1 --remove-empty --format=format:%H --no-merges -- "$DIR")
3434
if [ "$REV" ]; then
3535
echo "Directory '$DIR' contains non-upstream changes:"
3636
echo

0 commit comments

Comments
 (0)