[checkout] Don't fallback to tags only on failure.

`git fetch <tag>` works fine without out specifying `tag`, and this
allows fetching missing refs if necessary.

Change-Id: I9bebec01677b7de97982b517636dae01bb82e16f
Reviewed-on: https://fuchsia-review.googlesource.com/c/jiri/+/443561
Reviewed-by: Haowei Wu <haowei@google.com>
Commit-Queue: Nathan Mulcahey <nmulcahey@google.com>
diff --git a/project/project.go b/project/project.go
index 34bf283..f4f546d 100644
--- a/project/project.go
+++ b/project/project.go
@@ -1754,10 +1754,8 @@
 	}
 	jirix.Logger.Debugf("Checkout %s to head revision %s failed, fallback to fetch: %v", project.Name, revision, err)
 	if project.Revision != "" && project.Revision != "HEAD" {
-		//might be a tag
-		if err2 := fetch(jirix, project.Path, "origin", gitutil.FetchTagOpt(project.Revision)); err2 != nil {
-			// error while fetching tag, return original err and debug log this err
-			return fmt.Errorf("error while fetching tag after failed to checkout revision %s for project %s (%s): %s\ncheckout error: %v", revision, project.Name, project.Path, err2, err)
+		if err2 := git.FetchRefspec("origin", project.Revision); err2 != nil {
+			return fmt.Errorf("error while fetching after failed to checkout revision %s for project %s (%s): %s\ncheckout error: %v", revision, project.Name, project.Path, err2, err)
 		}
 		return git.CheckoutBranch(revision, gitutil.DetachOpt(true), gitutil.ForceOpt(forceCheckout))
 	}