fresh icon indicating copy to clipboard operation
fresh copied to clipboard

`--ref=foo` should work with remote branches

Open jasoncodes opened this issue 8 years ago • 1 comments

We currently call git show $REF:$PATH which does not match remote branches. It only works with commit refs and local branches names. When the branch has not been check

Do we need to failover to git show origin/$REF:$PATH if git show $REF:$PATH fails? Seems like the easiest option.

A missing ref currently outputs the following:

fatal: Not a valid object name $REF
Error: Could not find "$PATH" source file.
/home/user/.freshrc:1: fresh $REPO $PATH --ref=$REF

The first line is from the git show call. If we match origin/$REF after failing $REF, we should not output the fatal: Not a valid object name error from the first call. We should probably output both errors if both calls fail.

jasoncodes avatar May 06 '17 10:05 jasoncodes

+1, I recently had issue with remote branches

punk-dev-robot avatar May 26 '17 15:05 punk-dev-robot