diff options
author | Stefan Beller <sbeller@google.com> | 2016-03-29 18:27:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-30 13:09:36 -0700 |
commit | b08238ac3f5e4033d26824afc65e7397fbb61847 (patch) | |
tree | a523e8ec86c3c743d8b608488c1e5e35c480d668 /t/t7406-submodule-update.sh | |
parent | 10450cf72b51baf3bac6a779fb4e47241af7ae5e (diff) | |
download | git-b08238ac3f5e4033d26824afc65e7397fbb61847.tar.gz git-b08238ac3f5e4033d26824afc65e7397fbb61847.tar.xz |
submodule update: align reporting path for custom command execution
In the predefined actions (merge, rebase, none, checkout), we use
the display path, which is relative to the current working directory.
Also use the display path when running a custom command.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-x | t/t7406-submodule-update.sh | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index d4745f4d9..01dd3243d 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -344,16 +344,39 @@ test_expect_success 'submodule update - command in .git/config' ' ) ' +cat << EOF >expect +Execution of 'false $submodulesha1' failed in submodule path 'submodule' +EOF + test_expect_success 'submodule update - command in .git/config catches failure' ' (cd super && git config submodule.submodule.update "!false" ) && (cd super/submodule && - git reset --hard HEAD^ + git reset --hard $submodulesha1^ ) && (cd super && - test_must_fail git submodule update submodule - ) + test_must_fail git submodule update submodule 2>../actual + ) && + test_cmp actual expect +' + +cat << EOF >expect +Execution of 'false $submodulesha1' failed in submodule path '../submodule' +EOF + +test_expect_success 'submodule update - command in .git/config catches failure -- subdirectory' ' + (cd super && + git config submodule.submodule.update "!false" + ) && + (cd super/submodule && + git reset --hard $submodulesha1^ + ) && + (cd super && + mkdir tmp && cd tmp && + test_must_fail git submodule update ../submodule 2>../../actual + ) && + test_cmp actual expect ' test_expect_success 'submodule init does not copy command into .git/config' ' |