summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2018-10-07 17:46:41 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2018-10-08 13:41:43 +0000
commit0e0219118d2df43ee52d44ef5ca93354597d5508 (patch)
treebe40fce133ff51254335f828f0b68f052adca60c
parenta05533e425ebb36044680f403666dab7bc26a075 (diff)
downloadzsh-0e0219118d2df43ee52d44ef5ca93354597d5508.tar.gz
zsh-0e0219118d2df43ee52d44ef5ca93354597d5508.zip
43619: vcs_info git: In non-interactive rebases, always set $hook_com[git_patches_applied] to a string of the form 'foo bar', never just 'foo'.
-rw-r--r--ChangeLog5
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git13
2 files changed, 8 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 727d19f00..27052b0cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2018-10-08 Daniel Shahaf <d.s@daniel.shahaf.name>
+ * 43619: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+ vcs_info git: In non-interactive rebases, always set
+ $hook_com[git_patches_applied] to a string of the form 'foo bar',
+ never just 'foo'.
+
* 43618: Functions/VCS_Info/Backends/VCS_INFO_detect_p4,
Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr,
Functions/VCS_Info/Backends/VCS_INFO_get_data_git,
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 0050f613a..cd57902b6 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -260,18 +260,11 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
subject=$REPLY
}
fi
+ subject=${subject:-'?'}
if [[ -f "${patchdir}/original-commit" ]]; then
- if [[ -n $subject ]]; then
- git_patches_applied+=("$(< ${patchdir}/original-commit) $subject")
- else
- git_patches_applied+=("$(< ${patchdir}/original-commit)")
- fi
+ git_patches_applied+=("$(< ${patchdir}/original-commit) $subject")
else
- if [[ -n $subject ]]; then
- git_patches_applied+=("? $subject")
- else
- git_patches_applied+=("?")
- fi
+ git_patches_applied+=("? $subject")
fi
local last="$(< "${patchdir}/last")"
if (( cur+1 <= last )); then