From: Fred Hamster Date: Fri, 10 Jan 2025 16:01:42 +0000 (-0500) Subject: added check for .git above current dir X-Git-Tag: 2.140.189^2~37 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=ece5b340357a6a4fea53aca952fd3a8f368356ef;p=feisty_meow.git added check for .git above current dir --- diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index 2ad76f23..3ed09da1 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -515,6 +515,8 @@ function puff_out_list() # provides a list of absolute paths of revision control directories # that are located under the directory passed as the first parameter. +# if this does not result in any directories being found, then a recursive +# upwards search is done for git repos, which wants the .git directory. function generate_rev_ctrl_filelist() { local dir="$1"; shift @@ -530,7 +532,6 @@ function generate_rev_ctrl_filelist() find $dirhere -follow -maxdepth $MAX_DEPTH -type d -iname ".git" -exec echo {}/.. ';' >>$tempfile 2>/dev/null - # CVS is not well behaved like git and (now) svn, and we seldom use it anymore. popd &>/dev/null @@ -539,6 +540,12 @@ function generate_rev_ctrl_filelist() sed -i -e '/.*\/vendor\/.*/d' "$tempfile" fi + # check if we got any matches. if this is empty, we'll try our last ditch approach + # of searching above here for .git directories. + if [ ! -s "$tempfile" ]; then + seek_writable ".git" "up" >>$tempfile 2>/dev/null + fi + local sortfile=$(mktemp /tmp/zz_checkin_sort.XXXXXX) sort <"$tempfile" >"$sortfile" echo "$sortfile"