]> git.ipfire.org Git - thirdparty/git.git/commit
subtree: add comments and sanity checks
authorLuke Shumaker <lukeshu@datawire.io>
Tue, 27 Apr 2021 21:17:41 +0000 (15:17 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Apr 2021 07:47:18 +0000 (16:47 +0900)
commit5cdae0f6fd76bd1c12304240a17a5a12632fbb12
tree816c65eb84377a75bcdd7f09d1ee76bb342e6157
parentcbb5de8b83f3abde8f9b37b0048bc00344b6709b
subtree: add comments and sanity checks

For each function in subtree, add a usage comment saying what the
arguments are, and add an `assert` checking the number of arguments.

In figuring out each thing's arguments in order to write those comments
and assertions, it turns out that find_existing_splits is written as if
it takes multiple 'revs', but it is in fact only ever passed a single
'rev':

unrevs="$(find_existing_splits "$dir" "$rev")" || exit $?

So go ahead and codify that by documenting and asserting that it takes
exactly two arguments, one dir and one rev.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh