Skip to content

Commit 34ab458

Browse files
phil-blaingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5626a9e commit 34ab458

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ try_remove_previous () {
374374
# Usage: find_latest_squash DIR
375375
find_latest_squash () {
376376
assert test $# = 1
377+
dir="$1"
377378
debug "Looking for latest squash ($dir)..."
378379
local indent=$(($indent + 1))
379380

380-
dir="$1"
381381
sq=
382382
main=
383383
sub=

0 commit comments

Comments
 (0)