git-utils.sh: git_local_branch failes when using newer git

Bug #1908914 reported by Scott Little
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Triaged
Low
Scott Little

Bug Description

Brief Description
-----------------
git_local_branch is supposed to return the local branch name for a directory.
With newer versions of git, it sometimes gets confused and returning a tag name
instead.

Severity
--------
Minor

Steps to Reproduce
------------------
cd .repo/manifest
source git-utils.sh
git_local_branch $PWD

Expected Behavior
------------------
Returns the local branch name.
e.g. 'default' in the above scenario.

Actual Behavior
----------------
Sometimes it returns a tag instead, with a '~1' postfix.
I think git is now trying to say we are 'n' commits removed from the tag.
n=1 in this example.

This type of return value confuses the script that otherwise tries to filter out tags.

Reproducibility
---------------
Intermittent. Seems to depend on the version of git in use

System Configuration
--------------------
N/A

Branch/Pull Time/Commit
-----------------------
N/A

Last Pass
---------
N/A

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Build

Workaround
----------
N/A

Tags: stx.build
Scott Little (slittle1)
Changed in starlingx:
assignee: nobody → Scott Little (slittle1)
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Marking as low severity as indicated by the reporter

Changed in starlingx:
importance: Undecided → Low
status: New → Triaged
tags: added: stx.build
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.