Skip to content

Breaks after git garbage collection #93

@cjbarth

Description

@cjbarth

gift fundamentally breaks after a garbage collection. This is related to issue #92 . You can repeat this issue with the following script.

rm -rf git1
rm -rf git2

mkdir git1
cd git1
git init
echo test > f1.txt
git add f1.txt
git commit -m "Initial commit"
git branch HOTFIX/bigbug
git checkout HOTFIX/bigbug
echo tested > f1.txt
git add f1.txt
git commit -m "Fixed big bug"
git checkout master
echo tester > f2.txt
git add f2.txt
git commit -m "New file"
git branch HOTFIX/_integration
git checkout HOTFIX/_integration

git merge HOTFIX/bigbug -m "Merge bugfix"

git checkout master
git gc

cd ..

mkdir git2
cd git2
git clone ../git1

cd ../git1
git branch HOTFIX/littlebug
git branch develop

cd ../git2/git1

git branch HOTFIX/littlebug
git checkout HOTFIX/littlebug
echo littleBug > f3.txt
git add f3.txt
git commit -m "Fix little bug"
git checkout HOTFIX/_integration

# comment the following line to see this work properly
git gc


npm install gift

version='var git=require("gift"),repo=git(".");repo.branch(function(o,i){o&&console.log(o);var t={branch_name:i.name,commit_author:i.commit.author.name,commit_date:i.commit.committed_date,sha_revision:i.commit.id,short_sha_revision:i.commit.id.substr(0,7)};console.log(t)});'
echo $version > version.js
node version.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions