diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d634686b362c95..52251a33315776 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,7 +10,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -24,7 +24,7 @@ phases: exit 1 } - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-build-and-tests.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -44,7 +44,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -56,7 +56,7 @@ phases: exit 1 } - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-build-and-tests.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -76,7 +76,7 @@ phases: name: Hosted macOS steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 export CC=clang @@ -86,7 +86,7 @@ phases: exit 1 } - test -z "$GITFILESHAREPWD" || umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-build-and-tests.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -106,7 +106,7 @@ phases: name: Hosted macOS steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 ci/install-dependencies.sh ci/run-build-and-tests.sh || { @@ -114,7 +114,7 @@ phases: exit 1 } - test -z "$GITFILESHAREPWD" || umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-build-and-tests.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -134,7 +134,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -147,7 +147,7 @@ phases: exit 1 } - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-build-and-tests.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -171,7 +171,7 @@ phases: # Helper to check the error level of the latest command (exit with error when appropriate) function c() { if (!$?) { exit(1) } } - if ("$GITFILESHAREPWD" -ne "") { + if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") { net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no; c cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\; c } @@ -223,7 +223,7 @@ phases: "@ c - if ("$GITFILESHAREPWD" -ne "") { + if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") { cmd /c rmdir "$(Build.SourcesDirectory)\test-cache" } displayName: 'build & test' @@ -245,7 +245,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -266,7 +266,7 @@ phases: sudo chmod a+r t/out/TEST-*.xml - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-linux32-docker.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -286,7 +286,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -296,7 +296,7 @@ phases: ci/run-static-analysis.sh || exit 1 - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/run-static-analysis.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) @@ -308,7 +308,7 @@ phases: name: Hosted Ubuntu 1604 steps: - bash: | - test -z "$GITFILESHAREPWD" || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 sudo apt-get update && sudo rm /var/lib/apt/lists/lock && @@ -319,7 +319,7 @@ phases: ci/test-documentation.sh || exit 1 - test -z "$GITFILESHAREPWD" || sudo umount "$HOME/test-cache" || exit 1 + test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 displayName: 'ci/test-documentation.sh' env: GITFILESHAREPWD: $(gitfileshare.pwd) diff --git a/builtin/rebase--interactive.c b/builtin/rebase--interactive.c index 551faba558de3e..4b9d2a07cb235b 100644 --- a/builtin/rebase--interactive.c +++ b/builtin/rebase--interactive.c @@ -181,8 +181,9 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix) OPT_STRING(0, "upstream", &upstream, N_("upstream"), N_("the upstream commit")), OPT_STRING(0, "head-name", &head_name, N_("head-name"), N_("head name")), - OPT_STRING('S', "gpg-sign", &opts.gpg_sign, N_("gpg-sign"), - N_("GPG-sign commits")), + { OPTION_STRING, 'S', "gpg-sign", &opts.gpg_sign, N_("key-id"), + N_("GPG-sign commits"), + PARSE_OPT_OPTARG, NULL, (intptr_t) "" }, OPT_STRING(0, "strategy", &opts.strategy, N_("strategy"), N_("rebase strategy")), OPT_STRING(0, "strategy-opts", &raw_strategies, N_("strategy-opts"), diff --git a/builtin/rebase.c b/builtin/rebase.c index a28bfbd62f58d1..43bc6f791505fd 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1030,8 +1030,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "autosquash", &options.autosquash, N_("move commits that begin with " "squash!/fixup! under -i")), - OPT_STRING('S', "gpg-sign", &gpg_sign, - N_("gpg-sign?"), N_("GPG-sign commits")), + { OPTION_STRING, 'S', "gpg-sign", &gpg_sign, N_("key-id"), + N_("GPG-sign commits"), + PARSE_OPT_OPTARG, NULL, (intptr_t) "" }, OPT_STRING_LIST(0, "whitespace", &whitespace, N_("whitespace"), N_("passed to 'git apply'")), OPT_SET_INT('C', 0, &opt_c, N_("passed to 'git apply'"), diff --git a/builtin/stash.c b/builtin/stash.c index ed669dae0fb5ad..965e938ebd7a23 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -414,18 +414,19 @@ static int do_apply_stash(const char *prefix, struct stash_info *info, if (diff_tree_binary(&out, &info->w_commit)) { strbuf_release(&out); - return -1; + return error(_("Could not generate diff %s^!."), + oid_to_hex(&info->w_commit)); } ret = apply_cached(&out); strbuf_release(&out); if (ret) - return -1; + return error(_("Conflicts in index. Try without --index.")); discard_cache(); read_cache(); if (write_cache_as_tree(&index_tree, 0, NULL)) - return -1; + return error(_("Could not save index tree")); reset_head(); }