diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2023-03-22 10:27:03 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2024-01-09 16:38:20 +0000 |
commit | 3054ec0cb9193f6f86aeb112f8349acd8d0ae46a (patch) | |
tree | 7e47375f38507a3ffa6cbc9b9974f5f9c34256e9 /bin | |
parent | a176ee55da93b9ab77a91966743e0b1ad7ff795b (diff) |
gpush: try to determine a source branch more aggressively, part 1
so far, we stopped the iteration over `git branch --contains` when git
told us that HEAD is detached (which it would do as the first thing).
this would lead to ignoring the branch HEAD was detached from, thus
causing somewhat spurious "no upstream" notices. so don't do that
anymore.
Change-Id: I7ed341e875f307951eb110b3ca5e30e62a71879b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/git-gpush | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/git-gpush b/bin/git-gpush index 0b91a18..e5429af 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -851,8 +851,11 @@ sub branch_for_commit($) if (/^\* \(no branch, rebasing (.*)\)$/) { $curbranch = $1; $in_rebase = 1; + last; } - last; + # This is the "* (HEAD detached at [...])" case. + # The commit is somewhat likely still on the branch we + # detached from, so we continue here. } elsif (/^\* (.*)$/) { $curbranch = $1; last; |