From 4dcdd4a9d879b2787550e849673e7e967878fd92 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Sat, 26 Nov 2022 05:44:13 +0530 Subject: [PATCH] git: minor changes --- scripts/git.clj | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/git.clj b/scripts/git.clj index 370b315..e722c08 100755 --- a/scripts/git.clj +++ b/scripts/git.clj @@ -17,10 +17,13 @@ (filter #(has-git-repo %) (filter #(.isDirectory %) (.listFiles (io/file root))))) -(defn- git-pull [dir] (p/process ["git" "-C" dir "pull" "--rebase"])) +(defn- git-pull + "Do a git pull with rebase." + [dir] + (p/process ["git" "-C" dir "pull" "--rebase"])) (defn git-pull-all - "Runs `git-pull` on all the git repositories in a directory" + "Runs `git-pull` on all the git repositories in a directory." [root] (let [dirs (list-dirs root) pulls (->> root @@ -40,9 +43,9 @@ (defn git-pull-rebase-branch - "Do git pull and rebase branch with master" + "Do git pull and rebase branch with master." [dir] - (run-cmd ["git" "pull" "--rebase"]) + (git-pull dir) (let [current-branch (str/trim (run-cmd ["git" "branch" "--show-current"]))] (when (not (contains? #{"master" "main"} current-branch)) (run! print -- 2.43.0