We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6b9180 commit 183087eCopy full SHA for 183087e
src/koga/pin.lisp
@@ -1,9 +1,16 @@
1
(in-package #:koga)
2
3
+(defvar +head-branch-text+ "HEAD branch: ")
4
+
5
(defun pin-repo (pinp &key name extension directory repository branch commit freeze)
6
(when (and (not branch)
7
(probe-file directory))
- (setf branch (run-program-capture "git remote show origin | grep 'HEAD branch' | awk '{print $NF}'" :directory directory)))
8
+ (let* ((output (run-program-capture "git remote show origin" :directory directory))
9
+ (pos (search +head-branch-text+ output)))
10
+ (when pos
11
+ (setf branch (subseq output
12
+ (+ pos (length +head-branch-text+))
13
+ (position #\newline output :start pos))))))
14
(loop for (key value) on `(:name ,name
15
:extension ,extension
16
:directory ,directory
0 commit comments