From 560121a87b9ec768e50b84897c34a2607fa697e2 Mon Sep 17 00:00:00 2001
From: William Carroll <wpcarro@gmail.com>
Date: Thu, 15 Jun 2017 17:22:02 -0400
Subject: [PATCH] Adds git helper functions for viewing
 tracked,untracked,staged,unstaged files

---
 functions/git_functions.sh | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/functions/git_functions.sh b/functions/git_functions.sh
index 1a3293844..afbe11456 100644
--- a/functions/git_functions.sh
+++ b/functions/git_functions.sh
@@ -7,11 +7,23 @@ function wgbranch {
 # Outputs staged, unstaged, untracked files
 # Similar to `git status` output but without the cruft
 function wg-git-changed-files {
-    tracked_staged=$(git diff --name-only --staged)
-    tracked_unstaged=$(git diff --name-only)
-    untracked_unstaged=$(git ls-files --others --exclude-standard)
+  tracked_staged=$(wg-diff-tracked-staged)
+  tracked_unstaged=$(wg-diff-tracked-unstaged)
+  untracked_unstaged=$(wg-diff-untracked-unstaged)
 
-    echo "${tracked_staged}\n${tracked_unstaged}\n${untracked_unstaged}"
+  echo "${tracked_staged}\n${tracked_unstaged}\n${untracked_unstaged}"
+}
+
+function wg-diff-tracked-staged {
+  git --no-pager diff --name-only --staged
+}
+
+function wg-diff-tracked-unstaged {
+  git --no-pager diff --name-only
+}
+
+function wg-diff-untracked-unstaged {
+  git ls-files --others --exclude-standard
 }