Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-verify-submodule-gitdir-path.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / lib-verify-submodule-gitdir-path.sh` 24 lines ยท 880 bytes Raw Blame History 1 # Helper to verify if repo $1 contains a submodule named $2 with gitdir path $3 2 3 # This does not check filesystem existence. That is done in submodule.c via the 4 # submodule_name_to_gitdir() API which this helper ends up calling. The gitdirs 5 # might or might not exist (e.g. when adding a new submodule), so this only 6 # checks the expected configuration path, which might be overridden by the user. 7 8 verify_submodule_gitdir_path () { 9 repo="$1" && 10 name="$2" && 11 path="$3" && 12 ( 13 cd "$repo" && 14 # Compute expected absolute path 15 expected="$(git rev-parse --git-common-dir)/$path" && 16 expected="$(test-tool path-utils real_path "$expected")" && 17 # Compute actual absolute path 18 actual="$(git submodule--helper gitdir "$name")" && 19 actual="$(test-tool path-utils real_path "$actual")" && 20 echo "$expected" >expect && 21 echo "$actual" >actual && 22 test_cmp expect actual 23 ) 24 }