From: Joseph Nuthalapati Date: Sat, 26 Nov 2022 00:14:13 +0000 (+0530) Subject: git: minor changes X-Git-Url: https://njoseph.me/gitweb/babashka-scripts.git/commitdiff_plain git: minor changes --- 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