Bug(let): status reports 'can fast-forward' when not true
- From
Charles Bailey <charles@hashpling.org>
- Date
- Apr 21, 2009, 20:53 UTC
- Message-ID
- <20090421205352.GA29125@hashpling.org>
I was not really thinking when I get fetched, and ran git status on my pu branch. I was told that pu was behind origin/pu by 104 commits and could be fast-forwarded, so I git merged origin/pu and was mildly surprised when git merge made a commit for me.
A quick investigation revealed that pu had (of course) been rewound, but the only commits that it had that the new pu didn't, were merge commits.
I think that the problem is that in remote.c, a list of non-merge commits is generated for the status report. If it's non-zero, then it's the correct number of 'useful' commits to report, however if it is zero then this is not sufficient for a merge to fast-forward. The total number of commits unique to the local branch, including merges, must also be zero.
Is this a bug?
-- Charles Bailey http://ccgi.hashpling.plus.com/blog/