Title: Diff fails on empty repository. · Issue #41 · gitpython-developers/GitPython · GitHub
Open Graph Title: Diff fails on empty repository. · Issue #41 · gitpython-developers/GitPython
X Title: Diff fails on empty repository. · Issue #41 · gitpython-developers/GitPython
Description: If you have an empty repository (git init in an empty folder), then add files through GitPython, the repository isn't registered as "dirty" and diffs come back empty. For example: >>> r = Repo('.') >>> r.index.add(["README"]) >>> r.is_di...
Open Graph Description: If you have an empty repository (git init in an empty folder), then add files through GitPython, the repository isn't registered as "dirty" and diffs come back empty. For example: >>> r = Repo('.')...
X Description: If you have an empty repository (git init in an empty folder), then add files through GitPython, the repository isn't registered as "dirty" and diffs come back empty. For example: >...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/41
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Diff fails on empty repository.","articleBody":"If you have an empty repository (`git init` in an empty folder), then add files through GitPython, the repository isn't registered as \"dirty\" and diffs come back empty. For example:\n\n```\n\u003e\u003e\u003e r = Repo('.')\n\u003e\u003e\u003e r.index.add([\"README\"])\n\u003e\u003e\u003e r.is_dirty\nFalse\n\u003e\u003e\u003e r.index.diff(None)\n[]\n```\n\nThe index.entries property shows the newly added file, but there doesn't seem to be a way to turn it into \"this file has been added, but not committed\".\n","author":{"url":"https://github.com/nemec","@type":"Person","name":"nemec"},"datePublished":"2012-01-08T00:18:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/41/GitPython/issues/41"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9f54dc3-2bf7-11fd-a39d-4bdda73061f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC08:3D6AF9:2D613C:40D571:6A637766 |
| html-safe-nonce | 0814b62d9bf05f79cf7cfcb9291f853424fa95f1b0a3baa60e6ee13ff6603556 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzA4OjNENkFGOToyRDYxM0M6NDBENTcxOjZBNjM3NzY2IiwidmlzaXRvcl9pZCI6IjYyNjI2MzkzOTU0NTM3NjEzODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9e471d4bced1e416b23f993ace1d7dd1a3d43445a98309a0e342104f926f2cc7 |
| hovercard-subject-tag | issue:2758721 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/41/issue_layout |
| twitter:image | https://opengraph.githubassets.com/434435028b3725d45ca0741fa10d5d54310b1dfb4d8dc0eca718c69069b5b48d/gitpython-developers/GitPython/issues/41 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/434435028b3725d45ca0741fa10d5d54310b1dfb4d8dc0eca718c69069b5b48d/gitpython-developers/GitPython/issues/41 |
| og:image:alt | If you have an empty repository (git init in an empty folder), then add files through GitPython, the repository isn't registered as "dirty" and diffs come back empty. For example: >>> r = Repo('.')... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nemec |
| hostname | github.com |
| expected-hostname | github.com |
| None | 15e78334bb345f3864e70c5a376ed0383374123629b9e3022398d9431f6cd8bf |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 51da2d8d0a841a1393b806a6559fa9ad757e1666 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width