Re: [PATCH] Remove empty ref directories that prevent creating a ref.
From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:41
Christian Couder [off-list ref] writes:
+if [ -d "$GIT_DIR/refs/heads/$branchname" ]
+then
+ for refdir in `find "$GIT_DIR/refs/heads/$branchname" -type d | sort -r`
+ do
+ rmdir "$refdir" || \
+ die "Could not delete '$refdir', " \
+ "there may still be a ref there."
+ done
+fi
I do not think this loop is safe when $GIT_DIR contains any $IFS
character.