summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch
blob: b6d40dbc9f9447aa0a3f1264807f10db7cbbb89c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
guilt: allow operation outside of git repos

Sometimes guilt is sourced when there isn't a containing git repository.
Some of the git commands that are always called will report errors 
unecesarility in this scenario. This adds a variable that will inhibit
those problematic calls

Signed-off-by <bruce.ashfield@windriver.com>

---

 guilt |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)


--- a/guilt
+++ b/guilt
@@ -23,7 +23,9 @@ esac
 # we change directories ourselves
 SUBDIRECTORY_OK=1
 
-. "$(git --exec-path)/git-sh-setup"
+if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then
+    . "$(git --exec-path)/git-sh-setup"
+fi
 
 #
 # Git version check
@@ -921,14 +923,15 @@ diffstat=`git config --bool guilt.diffst
 # The following gets run every time this file is source'd
 #
 
-
 # GUILT_DIR="$GIT_DIR/patches"
 if [ -z "$GUILT_BASE" ]; then
 	GUILT_BASE=wrs
 fi
 GUILT_DIR="$GUILT_BASE/patches"
 
-branch=`get_branch`
+if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then
+    branch=`get_branch`
+fi
 
 # most of the time we want to verify that the repo's branch has been
 # initialized, but every once in a blue moon (e.g., we want to run guilt-init),