Bug 347349

Summary: initBranchHash crashes on empty git repository
Product: [Developer tools] kdevplatform Reporter: Milian Wolff <mail>
Component: gitAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash CC: aleixpol
Priority: NOR Keywords: junior-jobs
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Milian Wolff 2015-05-06 22:15:21 UTC
see e.g. https://build.kde.org/job/kdevplatform%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/55/testReport/(root)/TestSuite/test_kdevgit/

QDEBUG : GitInitTest::revHistory() kdevplatform.vcs: Execute dvcs command: "git symbolic-ref -q --short HEAD"
QDEBUG : GitInitTest::revHistory() kdevplatform.vcs: Execute dvcs command: "git rev-list master"
QDEBUG : GitInitTest::revHistory() kdevplatform.vcs: oops, found an error while running "git rev-list master" : "UnknownError" Exit code is: 128

this happens on a bare repository without any commits (due to another error). to reproduce try to run this e.g.:

cd /tmp
mkdir test
cd test
git init
git rev-list master
# fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
# Use '--' to separate paths from revisions, like this:
# 'git <command> [<revision>...] -- [<file>...]'

this will then lead to the assert in the kdevelop code base

Reproducible: Always
Comment 1 Aleix Pol 2016-09-06 21:24:19 UTC
Test is passing, can't see the error message when running the test.