Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
code-generic
code-webis-cmd
Commits
988bf45c
Commit
988bf45c
authored
Nov 15, 2020
by
Alban Bruder
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for updates on curent branch
parent
24481786
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
libs/bashhelper.sh
libs/bashhelper.sh
+4
-3
No files found.
libs/bashhelper.sh
View file @
988bf45c
...
...
@@ -274,15 +274,16 @@ is_var_set() {
### Check if the git repository in CWD has unpulled commits on the
###
master
branch, without actually fetching anything.
###
current
branch, without actually fetching anything.
###
### \params $1 remote (default: origin)
### \params $2 branch (default:
master
)
### \params $2 branch (default:
current
)
git_repo_has_updates
()
{
(
cd
"
$WEBIS_CMD_ROOT_PATH
"
branch
=
"
$(
git branch
--show-current
)
"
local_ref
=
"
$(
git rev-parse HEAD
)
"
remote_ref
=
"
$(
git ls-remote
"
${
1
:-
origin
}
"
|
grep
"refs/heads/
${
2
:-
master
}
"
|
cut
-f1
)
"
remote_ref
=
"
$(
git ls-remote
"
${
1
:-
origin
}
"
|
grep
"refs/heads/
${
2
:-
$branch
}
"
|
cut
-f1
)
"
[
"
$local_ref
"
!=
"
$remote_ref
"
]
&&
git merge-base
--is-ancestor
"
${
1
:-
origin
}
/
${
2
:-
master
}
"
HEAD
)
}
Alban Bruder
@yopu1760
mentioned in commit
2bfd7837
·
Nov 16, 2020
mentioned in commit
2bfd7837
mentioned in commit 2bfd783792a219ca915fd4b9aba8d27e0405b9db
Toggle commit list
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