File tree Expand file tree Collapse file tree
share/github-backup-utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ ghe_remote_version_required "$host"
2626# to an older version of GHE or no data has been added to this directory yet.
2727ghe-ssh " $host " -- " [ -d '$GHE_REMOTE_DATA_USER_DIR /$dirname ' ]" || exit 0
2828
29- # If we have a previous increment, avoid transferring existing files via rsync's
29+ # If we have a previous increment and it is not empty , avoid transferring existing files via rsync's
3030# --link-dest support. This also decreases physical space usage considerably.
31- if [ -d " $GHE_DATA_DIR /current/$dirname " ]; then
31+ if [ -d " $GHE_DATA_DIR /current/$dirname " ] && [ " $( ls -A $GHE_DATA_DIR /current/ $dirname ) " ] ; then
3232 link_dest=" --link-dest=../../current/$dirname "
3333fi
3434
Original file line number Diff line number Diff line change @@ -251,3 +251,16 @@ begin_test "ghe-backup without manage-password file"
251251 [ ! -f " $GHE_DATA_DIR /current/manage-password" ]
252252)
253253end_test
254+
255+ begin_test " ghe-backup empty hookshot directory"
256+ (
257+ set -e
258+
259+ rm -rf $GHE_REMOTE_DATA_USER_DIR /hookshot/repository-*
260+ rm -rf $GHE_DATA_DIR /current/hookshot/repository-*
261+ ghe-backup
262+
263+ # Check that the "--link-dest arg does not exist" message hasn't occurred.
264+ [ ! " $( grep " [l]ink-dest arg does not exist" $TRASHDIR /out) " ]
265+ )
266+ end_test
You can’t perform that action at this time.
0 commit comments