]> njoseph.me Git - babashka-scripts.git/commitdiff
git: minor changes master
authorJoseph Nuthalapati <njoseph@riseup.net>
Sat, 26 Nov 2022 00:14:13 +0000 (05:44 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Sat, 26 Nov 2022 00:14:13 +0000 (05:44 +0530)
scripts/git.clj

index 370b3158af02ba81a2289a02b00e42f96cee349c..e722c08322476b6162b0663d69d74129b1b0036f 100755 (executable)
   (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