Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
457b9d36
Commit
457b9d36
authored
Mar 14, 2016
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make has_changes_against_upstream_branch detect uncommitted changes
parent
4c2d129b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
util.sh
hack/lib/util.sh
+10
-3
No files found.
hack/lib/util.sh
View file @
457b9d36
...
...
@@ -332,13 +332,20 @@ kube::util::has_changes_against_upstream_branch() {
echo
"Checking for '
${
pattern
}
' changes against '
${
full_branch
}
'"
# make sure the branch is valid, otherwise the check will pass erroneously.
if
!
git describe
"
${
full_branch
}
"
>
/dev/null
;
then
# abort!
exit
1
fi
# notice this uses ... to find the first shared ancestor
if
!
git diff
--name-only
"
${
full_branch
}
...HEAD"
|
grep
"
${
pattern
}
"
>
/dev/null
;
then
echo
"No '
${
pattern
}
' changes detected."
return
1
if
git diff
--name-only
"
${
full_branch
}
...HEAD"
|
grep
"
${
pattern
}
"
>
/dev/null
;
then
return
0
fi
# also check for pending changes
if
git status
--porcelain
|
grep
"
${
pattern
}
"
>
/dev/null
;
then
echo
"Detected '
${
pattern
}
' uncommitted changes."
return
0
fi
echo
"No '
${
pattern
}
' changes detected."
return
1
}
# ex: ts=2 sw=2 et filetype=sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment