Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] vcs_info: test -f .git/rebase-merge/done before reading it



From: Daniel Hahler <git@xxxxxxxxxx>

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 48d552f..fe1c356 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -204,11 +204,13 @@ then
     VCS_INFO_git_handle_patches
 elif [[ -d "${gitdir}/rebase-merge" ]]; then
     patchdir="${gitdir}/rebase-merge"
-    local p
-    for p in ${(f)"$(< "${patchdir}/done")"}; do
-        # remove action
-        git_patches_applied+=("${${(s: :)p}[2,-1]}")
-    done
+    if [[ -f ${patchdir}/done ]]; then
+        local p
+        for p in ${(f)"$(< "${patchdir}/done")"}; do
+            # remove action
+            git_patches_applied+=("${${(s: :)p}[2,-1]}")
+        done
+    fi
     git_patches_unapplied=(${(f)"$(grep -v '^$' "${patchdir}/git-rebase-todo" | grep -v '^#')"})
     VCS_INFO_git_handle_patches
 elif [[ -d "${gitdir}/rebase-apply" ]]; then
-- 
2.1.0



Messages sorted by: Reverse Date, Date, Thread, Author