subtree: define a variable before its first use in 'find_latest_squash'

The function 'find_latest_squash' takes a single argument, 'dir', but a debug statement uses this variable before it takes its value from $1. This statement thus gets the value of 'dir' from the calling function, which currently is the same as the 'dir' argument, so it works but it is confusing. Move the definition of 'dir' before its first use. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philippe Blain committed Oct 21, 2022 at 15:13 UTC 34ab458cb1df13ca400c10bbc4ff69c75a4e217e
1 file changed +1 -1
contrib/subtree/git-subtree.sh
+1 -1
@@ -374,10 +374,10 @@ try_remove_previous () {
374 # Usage: find_latest_squash DIR
375 find_latest_squash () {
376 assert test $# = 1
377 + dir="$1"
378 debug "Looking for latest squash ($dir)..."
379 local indent=$(($indent + 1))
380
380 - dir="$1"
381 sq=
382 main=
383 sub=