zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH] vcs_info: test -f .git/rebase-merge/done before reading it
Date: Sat, 22 Nov 2014 18:20:52 +0100	[thread overview]
Message-ID: <1416676852-3355-1-git-send-email-genml+zsh-workers@thequod.de> (raw)
In-Reply-To: <5470C427.4050805@thequod.de>

From: Daniel Hahler <git@thequod.de>

---
 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


  reply	other threads:[~2014-11-22 17:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 17:13 BUG: failure in "vcs_info prompt" aborts precmd function Daniel Hahler
2014-11-22 17:20 ` Daniel Hahler [this message]
2014-11-22 17:51 ` Mikael Magnusson
2014-11-22 18:01   ` Daniel Hahler
2014-11-22 22:20     ` Mikael Magnusson
2014-11-22 22:44       ` Bart Schaefer
2014-11-23 19:02         ` Peter Stephenson
2014-11-23 19:38           ` Bart Schaefer
2014-11-23 20:04             ` Peter Stephenson
2014-11-23 15:58       ` Daniel Hahler
2014-11-23 18:08         ` Mikael Magnusson
2014-11-23 19:57           ` TRY_BLOCK_ERROR and exit status Bart Schaefer
2014-11-24 10:11             ` Peter Stephenson
2014-11-25  8:01               ` Bart Schaefer
2014-11-25  9:18                 ` Peter Stephenson
2014-11-23 18:13         ` BUG: failure in "vcs_info prompt" aborts precmd function Bart Schaefer
2014-11-23 18:52           ` Mikael Magnusson
2014-11-23 19:47             ` Bart Schaefer
2014-11-23 22:03           ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416676852-3355-1-git-send-email-genml+zsh-workers@thequod.de \
    --to=genml+zsh-workers@thequod.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).