From 73867263eddc23d1e8ddd11d08ba1996cd35c8dd Mon Sep 17 00:00:00 2001
From: Hans Kristian Hoel <hanskhoe@stud.ntnu.no>
Date: Wed, 30 Oct 2019 12:26:28 +0100
Subject: [PATCH] Fixed auth so that it skips the non existing repositories

---
 assignment2/commit.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/assignment2/commit.go b/assignment2/commit.go
index c27774e..83f78f3 100644
--- a/assignment2/commit.go
+++ b/assignment2/commit.go
@@ -85,7 +85,8 @@ func HandlerCommits(w http.ResponseWriter, r *http.Request) {
 
 		TempCommit, err := strconv.Atoi(resp.Header.Get("X-Total")) // gets total of commits
 		if err != nil {                                             //check for error
-			log.Fatal(err)
+			fmt.Println("Repository do not exist, ID: ", I[i].ID)
+			TempCommit = 0 // if repository do not exist, sets commit to 0
 		}
 
 		C.Repos[i].Commits = TempCommit // sets commits count in to C.Repos
-- 
GitLab