Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in stash/rebase fixes #1852

Merged
merged 4 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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)
Expand All @@ -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 &&
Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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)
Expand All @@ -106,15 +106,15 @@ 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 || {
ci/print-test-failures.sh
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)
Expand All @@ -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 &&
Expand All @@ -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)
Expand All @@ -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
}
Expand Down Expand Up @@ -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'
Expand All @@ -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 &&
Expand All @@ -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)
Expand All @@ -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 &&
Expand All @@ -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)
Expand All @@ -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 &&
Expand All @@ -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)
5 changes: 3 additions & 2 deletions builtin/rebase--interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
5 changes: 3 additions & 2 deletions builtin/rebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'"),
Expand Down
7 changes: 4 additions & 3 deletions builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down