summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-08-21 13:03:03 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2024-01-09 16:34:37 +0000
commit14efb017a1dba0ccb3b4c0c5afec615a56217fe7 (patch)
tree2778e4b4e7ab9a3fc9c14272fedc81fd716c2262 /bin
parent5f81c08cbc8f633ad272e116abc0312222cae967 (diff)
gpush: inline get_1st_commit()
it's trivial and there was only one caller. Change-Id: If1c1d925470a377e08ade71bdf888161fd798970 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-gpush2
-rw-r--r--bin/git_gpush.pm7
2 files changed, 1 insertions, 8 deletions
diff --git a/bin/git-gpush b/bin/git-gpush
index 1b31685..cba6aaf 100755
--- a/bin/git-gpush
+++ b/bin/git-gpush
@@ -1334,7 +1334,7 @@ sub rebase_commit($$$$$)
my ($commit, $base_id, $old_commit, $old_base_id, $orig_id) = @_;
my $parents = $$commit{parents};
- my $parent_id = get_1st_commit($parents);
+ my $parent_id = @$parents ? $$parents[0] : 'ROOT';
if ($base_id eq $parent_id) {
# Same base, so no need to actually rebase.
diff --git a/bin/git_gpush.pm b/bin/git_gpush.pm
index 24631ec..030ce00 100644
--- a/bin/git_gpush.pm
+++ b/bin/git_gpush.pm
@@ -596,13 +596,6 @@ sub changes_from_commits($)
return [ map { $$_{change} } @$commits ];
}
-sub get_1st_commit($)
-{
- my ($parents) = @_;
-
- return @$parents ? $$parents[0] : 'ROOT';
-}
-
sub get_1st_parent($)
{
my ($commit) = @_;