Skip to content
Snippets Groups Projects
Commit 33e857f5 authored by Jani Nikula's avatar Jani Nikula
Browse files

dim: reduce indent in commit_rerere_cache


Bail out early on errors to reduce indent. Add local decls while at it.

Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent af95e7dc
No related tags found
No related merge requests found
......@@ -589,39 +589,41 @@ function update_rerere_cache
function commit_rerere_cache
{
local remote file
echo -n "Updating rerere cache... "
cd $DIM_PREFIX/drm-rerere/
if git_is_current_branch rerere-cache ; then
remote=$(branch_to_remote rerere-cache)
if ! git_is_current_branch rerere-cache; then
echo "Fail: Branch setup for the rerere-cache is borked."
exit 1
fi
if ! git pull -q ; then
echoerr "Failed to update the rerere cache."
echoerr "Please manually run"
echoerr " $ cd $DIM_PREFIX/drm-rerere ; git pull"
echoerr "and fixup any issues."
remote=$(branch_to_remote rerere-cache)
return 1
fi
git add ./*.patch >& /dev/null || true
for file in $(git ls-files -- rr-cache); do
if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then
git rm $file &> /dev/null || true
fi
done
find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | xargs -0 git add > /dev/null || true
git rm rr-cache/rr-cache &> /dev/null || true
if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then
echo -n "New commit. "
else
echo -n "Nothing changed. "
if ! git pull -q; then
echoerr "Failed to update the rerere cache."
echoerr "Please manually run"
echoerr " $ cd $DIM_PREFIX/drm-rerere; git pull"
echoerr "and fixup any issues."
return 1
fi
git add ./*.patch >& /dev/null || true
for file in $(git ls-files -- rr-cache); do
if ! git log --since="60 days ago" --name-only -- $file | grep $file &> /dev/null; then
git rm $file &> /dev/null || true
fi
echo -n "Pushing rerere cache... "
git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done."
done
find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | xargs -0 git add > /dev/null || true
git rm rr-cache/rr-cache &> /dev/null || true
if git commit -m "$time: $integration_branch rerere cache update" >& /dev/null; then
echo -n "New commit. "
else
echo "Fail: Branch setup for the rerere-cache is borked."
exit 1
echo -n "Nothing changed. "
fi
echo -n "Pushing rerere cache... "
git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done."
}
function dim_rebuild_tip
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment