diff options
Diffstat (limited to 'meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch')
-rw-r--r-- | meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch b/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch new file mode 100644 index 0000000000..b6d40dbc9f --- /dev/null +++ b/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | guilt: allow operation outside of git repos | ||
2 | |||
3 | Sometimes guilt is sourced when there isn't a containing git repository. | ||
4 | Some of the git commands that are always called will report errors | ||
5 | unecesarility in this scenario. This adds a variable that will inhibit | ||
6 | those problematic calls | ||
7 | |||
8 | Signed-off-by <bruce.ashfield@windriver.com> | ||
9 | |||
10 | --- | ||
11 | |||
12 | guilt | 9 ++++++--- | ||
13 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
14 | |||
15 | |||
16 | --- a/guilt | ||
17 | +++ b/guilt | ||
18 | @@ -23,7 +23,9 @@ esac | ||
19 | # we change directories ourselves | ||
20 | SUBDIRECTORY_OK=1 | ||
21 | |||
22 | -. "$(git --exec-path)/git-sh-setup" | ||
23 | +if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then | ||
24 | + . "$(git --exec-path)/git-sh-setup" | ||
25 | +fi | ||
26 | |||
27 | # | ||
28 | # Git version check | ||
29 | @@ -921,14 +923,15 @@ diffstat=`git config --bool guilt.diffst | ||
30 | # The following gets run every time this file is source'd | ||
31 | # | ||
32 | |||
33 | - | ||
34 | # GUILT_DIR="$GIT_DIR/patches" | ||
35 | if [ -z "$GUILT_BASE" ]; then | ||
36 | GUILT_BASE=wrs | ||
37 | fi | ||
38 | GUILT_DIR="$GUILT_BASE/patches" | ||
39 | |||
40 | -branch=`get_branch` | ||
41 | +if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then | ||
42 | + branch=`get_branch` | ||
43 | +fi | ||
44 | |||
45 | # most of the time we want to verify that the repo's branch has been | ||
46 | # initialized, but every once in a blue moon (e.g., we want to run guilt-init), | ||