Code

Fix bug introduced in commit for using --exclude-standard flag
authorJonas Fonseca <fonseca@diku.dk>
Tue, 7 Oct 2008 12:18:01 +0000 (14:18 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 7 Oct 2008 12:18:01 +0000 (14:18 +0200)
Introduced in commit 33623c0022b49a5f2774b37a58726a95a4367447. The bug
is reproducible when running tig status in a newly created repository.

tig.c

diff --git a/tig.c b/tig.c
index 25a6d76027fa6621c3ea88ce21cb9b7d826a07b0..84ac268b608bf38b6fd7828579136483ce3a5aec 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4045,11 +4045,12 @@ status_open(struct view *view)
 
        system("git update-index -q --refresh >/dev/null 2>/dev/null");
 
-       if (opt_no_head &&
-           !status_run(view, STATUS_LIST_NO_HEAD_CMD, 'A', LINE_STAT_STAGED))
-               return FALSE;
-       else if (!status_run(view, STATUS_DIFF_INDEX_CMD, 0, LINE_STAT_STAGED))
+       if (opt_no_head) {
+               if (!status_run(view, STATUS_LIST_NO_HEAD_CMD, 'A', LINE_STAT_STAGED))
+                       return FALSE;
+       } else if (!status_run(view, STATUS_DIFF_INDEX_CMD, 0, LINE_STAT_STAGED)) {
                return FALSE;
+       }
 
        if (!status_run(view, STATUS_DIFF_FILES_CMD, 0, LINE_STAT_UNSTAGED) ||
            !status_run(view, STATUS_LIST_OTHER_CMD, '?', LINE_STAT_UNTRACKED))