Skip to content

Commit

Permalink
If this is the initial commit to the repo, all files have changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpunk committed Mar 23, 2016
1 parent f26a91b commit c907bea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pre-receive
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ while read -r oldrev newrev refname; do
oldrev=$(git show-branch | grep '\*' | grep -v "$newrev" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//')
fi

for changedfile in $(git diff --name-only "$oldrev" "$newrev" --diff-filter=ACM); do
if [[ "x$oldrev" == 'x' ]]; then
files_list=$(git ls-tree --full-tree -r HEAD --name-only)
else
files_list=$(git diff --name-only "$oldrev" "$newrev" --diff-filter=ACM)
fi

for changedfile in $files_list; do
tmpmodule="$tmptree/$changedfile"
[[ -f "$tmpmodule" ]] || continue
#check puppet manifest syntax
Expand Down

0 comments on commit c907bea

Please sign in to comment.