Skip to content
Permalink
Browse files

Merge pull request #1852 from dscho/built-in-stash-rebase-fixes

Built-in stash/rebase fixes
  • Loading branch information...
jamill committed Sep 27, 2018
2 parents d6a9496 + fb77ec5 commit a5565b477c2d403854044c26bdf40b6d81031b2f
Showing with 28 additions and 25 deletions.
  1. +18 −18 azure-pipelines.yml
  2. +3 −2 builtin/rebase--interactive.c
  3. +3 −2 builtin/rebase.c
  4. +4 −3 builtin/stash.c
@@ -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,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)
@@ -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)
@@ -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"),
@@ -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'"),
@@ -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();
}

0 comments on commit a5565b4

Please sign in to comment.
You can’t perform that action at this time.