Skip to content

Commit

Permalink
verify-subtree.sh: relax check and ignore old content
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pohly committed Mar 6, 2019
1 parent 33d58fd commit cc564f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion verify-subtree.sh
Expand Up @@ -30,7 +30,7 @@ if [ ! "$DIR" ]; then
exit 1
fi

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

0 comments on commit cc564f9

Please sign in to comment.